aboutsummaryrefslogtreecommitdiff
path: root/docs/ext
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-04-29 03:18:25 -0400
committerRapptz <[email protected]>2019-04-29 23:34:20 -0400
commit55e3e242ff8959a4ed52fc002273e7e2b6355e23 (patch)
tree369b2d457bbc9ed21d92c66fbee4237239a6ea65 /docs/ext
parentProper location of versionadded (diff)
downloaddiscord.py-55e3e242ff8959a4ed52fc002273e7e2b6355e23.tar.xz
discord.py-55e3e242ff8959a4ed52fc002273e7e2b6355e23.zip
[tasks] Remove support for awaitables due to gotchas.
Fixes #2079
Diffstat (limited to 'docs/ext')
-rw-r--r--docs/ext/tasks/index.rst20
1 files changed, 0 insertions, 20 deletions
diff --git a/docs/ext/tasks/index.rst b/docs/ext/tasks/index.rst
index 93e7b3f8..2aeae796 100644
--- a/docs/ext/tasks/index.rst
+++ b/docs/ext/tasks/index.rst
@@ -81,26 +81,6 @@ Waiting until the bot is ready before the loop starts:
class MyCog(commands.Cog):
def __init__(self, bot):
self.index = 0
- self.printer.before_loop(bot.wait_until_ready())
- self.printer.start()
-
- def cog_unload(self):
- self.printer.cancel()
-
- @tasks.loop(seconds=5.0)
- async def printer(self):
- print(self.index)
- self.index += 1
-
-:meth:`~.tasks.Loop.before_loop` can be used as a decorator as well:
-
-.. code-block:: python3
-
- from discord.ext import tasks, commands
-
- class MyCog(commands.Cog):
- def __init__(self, bot):
- self.index = 0
self.bot = bot
self.printer.start()