From 55e3e242ff8959a4ed52fc002273e7e2b6355e23 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 29 Apr 2019 03:18:25 -0400 Subject: [tasks] Remove support for awaitables due to gotchas. Fixes #2079 --- docs/ext/tasks/index.rst | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'docs/ext') 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 @@ -74,26 +74,6 @@ Looping a certain amount of times before exiting: Waiting until the bot is ready before the loop starts: -.. code-block:: python3 - - from discord.ext import tasks, commands - - 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 -- cgit v1.2.3