diff options
| author | Rapptz <[email protected]> | 2019-03-19 06:21:39 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-03-19 09:23:10 -0400 |
| commit | 26e9b5bfac840c95744bbdd0ab356842e9efa72f (patch) | |
| tree | 73acd0cfb36e19719ace297422029bc387572d4f /docs | |
| parent | [commands] ColourConverter raises if value is out of range (diff) | |
| download | discord.py-26e9b5bfac840c95744bbdd0ab356842e9efa72f.tar.xz discord.py-26e9b5bfac840c95744bbdd0ab356842e9efa72f.zip | |
[commands] Add Bot.reload_extension for atomic loading.
Also do atomic loading in Bot.load_extension
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ext/commands/extensions.rst | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/ext/commands/extensions.rst b/docs/ext/commands/extensions.rst index 91fbb24a..10e33e45 100644 --- a/docs/ext/commands/extensions.rst +++ b/docs/ext/commands/extensions.rst @@ -41,14 +41,13 @@ In this example we define a simple command, and when the extension is loaded thi Reloading ----------- -The act of reloading an extension is actually quite simple -- it is as simple as unloading it and then reloading it. +When you make a change to the extension and want to reload the references, the library comes with a function to do this for you, :meth:`Bot.reload_extension`. .. code-block:: python3 - >>> bot.unload_extension('hello') - >>> bot.load_extension('hello') + >>> bot.reload_extension('hello') -Once we remove and load the extension, any changes that we did will be applied upon load. This is useful if we want to add or remove functionality without restarting our bot. +Once the extension reloads, any changes that we did will be applied. This is useful if we want to add or remove functionality without restarting our bot. If an error occurred during the reloading process, the bot will pretend as if the reload never happened. Cleaning Up ------------- |