diff options
| author | Rapptz <[email protected]> | 2019-04-18 19:49:57 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-04-18 19:49:57 -0400 |
| commit | c3bad4eeab3b4244be99c97b54eb3ece21d65fd8 (patch) | |
| tree | 7b71a4f8113913f751fd301adde7581bb61f244a /docs | |
| parent | Add versionchanged to Message.delete (diff) | |
| download | discord.py-c3bad4eeab3b4244be99c97b54eb3ece21d65fd8.tar.xz discord.py-c3bad4eeab3b4244be99c97b54eb3ece21d65fd8.zip | |
Make context documentation in migration a bit more clear.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/migrating.rst | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/docs/migrating.rst b/docs/migrating.rst index 543e8f25..4dc86531 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -803,21 +803,25 @@ will either DM the user in a DM context or send a message in the channel it was functionality. The old helpers have been removed in favour of the new :class:`abc.Messageable` interface. See :ref:`migrating_1_0_removed_helpers` for more information. -Since the :class:`~ext.commands.Context` is now by default passed, several shortcuts have been added: +Since the :class:`~ext.commands.Context` is now passed by default, several shortcuts have been added: **New Shortcuts** -- :attr:`~ext.commands.Context.author` is a shortcut for ``ctx.message.author``. -- :attr:`~ext.commands.Context.guild` is a shortcut for ``ctx.message.guild``. -- :attr:`~ext.commands.Context.channel` is a shortcut for ``ctx.message.channel``. -- :attr:`~ext.commands.Context.me` is a shortcut for ``ctx.message.guild.me`` or ``ctx.bot.user``. -- :attr:`~ext.commands.Context.voice_client` is a shortcut for ``ctx.message.guild.voice_client``. +- :attr:`ctx.author <ext.commands.Context.author>` is a shortcut for ``ctx.message.author``. +- :attr:`ctx.guild <ext.commands.Context.guild>` is a shortcut for ``ctx.message.guild``. +- :attr:`ctx.channel <ext.commands.Context.channel>` is a shortcut for ``ctx.message.channel``. +- :attr:`ctx.me <ext.commands.Context.me>` is a shortcut for ``ctx.message.guild.me`` or ``ctx.bot.user``. +- :attr:`ctx.voice_client <ext.commands.Context.voice_client>` is a shortcut for ``ctx.message.guild.voice_client``. **New Functionality** -- :meth:`~.Context.reinvoke` to invoke a command again. +- :meth:`.Context.reinvoke` to invoke a command again. - This is useful for bypassing cooldowns. +- :attr:`.Context.valid` to check if a context can be invoked with :meth:`.Bot.invoke`. +- :meth:`.Context.send_help` to show the help command for an entity using the new :class:`~.ext.commands.HelpCommand` system. + + - This is useful if you want to show the user help if they misused a command. Subclassing Context ++++++++++++++++++++ |