mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 10:49:24 +00:00
[tasks] Return coro from before and after decorators
This commit is contained in:
parent
357abf2e55
commit
859ee751f9
@ -271,7 +271,7 @@ class Loop:
|
|||||||
raise TypeError('Expected coroutine function, received {0.__name__!r}.'.format(type(coro)))
|
raise TypeError('Expected coroutine function, received {0.__name__!r}.'.format(type(coro)))
|
||||||
|
|
||||||
self._before_loop = coro
|
self._before_loop = coro
|
||||||
|
return coro
|
||||||
|
|
||||||
def after_loop(self, coro):
|
def after_loop(self, coro):
|
||||||
"""A decorator that register a coroutine to be called after the loop finished running.
|
"""A decorator that register a coroutine to be called after the loop finished running.
|
||||||
@ -299,6 +299,7 @@ class Loop:
|
|||||||
raise TypeError('Expected coroutine function, received {0.__name__!r}.'.format(type(coro)))
|
raise TypeError('Expected coroutine function, received {0.__name__!r}.'.format(type(coro)))
|
||||||
|
|
||||||
self._after_loop = coro
|
self._after_loop = coro
|
||||||
|
return coro
|
||||||
|
|
||||||
def loop(*, seconds=0, minutes=0, hours=0, count=None, reconnect=True, loop=None):
|
def loop(*, seconds=0, minutes=0, hours=0, count=None, reconnect=True, loop=None):
|
||||||
"""A decorator that schedules a task in the background for you with
|
"""A decorator that schedules a task in the background for you with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user