From bad92723fc9be2d547806f75ef9ae22740a26e01 Mon Sep 17 00:00:00 2001 From: Gnome Date: Fri, 3 Sep 2021 20:48:43 +0100 Subject: [PATCH] Add basic documentation on slash commands --- docs/ext/commands/commands.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/ext/commands/commands.rst b/docs/ext/commands/commands.rst index f205be2a..829fa24a 100644 --- a/docs/ext/commands/commands.rst +++ b/docs/ext/commands/commands.rst @@ -61,6 +61,13 @@ the name to something other than the function would be as simple as doing this: async def _list(ctx, arg): pass +Slash Commands +-------------- +Slash Commands can be enabled in the :class:`.Bot` constructor or :class:`.Command` constructor, using +``slash_commands=True`` or ``slash_command=True`` respectfully. All features of the commands extension +should work with these options enabled, however many will not have direct discord counterparts and therefore +will be subsituted for supported versions when uploaded to discord. + Parameters ------------ @@ -179,6 +186,11 @@ know how the command was executed. It contains a lot of useful information: The context implements the :class:`abc.Messageable` interface, so anything you can do on a :class:`abc.Messageable` you can do on the :class:`~ext.commands.Context`. +.. warning:: + :attr:`.Context.message` will be fake if in a slash command, it is not recommended to use this attribute + if :attr:`.Context.interaction` is not None. Currently this will emit a warning and fail silently, however + this behaviour may be changed in the future. + Converters ------------