[commads] Change cog/extension load/unload methods to be async

This commit is contained in:
Josh
2022-03-14 11:03:45 +10:00
committed by GitHub
parent a339e01047
commit a1c618215e
8 changed files with 210 additions and 50 deletions

View File

@ -58,7 +58,7 @@ Once you have defined your cogs, you need to tell the bot to register the cogs t
.. code-block:: python3
bot.add_cog(Greetings(bot))
await bot.add_cog(Greetings(bot))
This binds the cog to the bot, adding all commands and listeners to the bot automatically.
@ -66,7 +66,7 @@ Note that we reference the cog by name, which we can override through :ref:`ext_
.. code-block:: python3
bot.remove_cog('Greetings')
await bot.remove_cog('Greetings')
Using Cogs
-------------
@ -112,6 +112,7 @@ As cogs get more complicated and have more commands, there comes a point where w
They are as follows:
- :meth:`.Cog.cog_load`
- :meth:`.Cog.cog_unload`
- :meth:`.Cog.cog_check`
- :meth:`.Cog.cog_command_error`