Skip to content

Commit 1fb34ce

Browse files
Merge branch 'master' into new-ui-changes
2 parents 4957542 + 2a9ebcf commit 1fb34ce

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

discord_slash/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ def add_slash_command(self,
327327
"""
328328
Registers slash command to SlashCommand.
329329
330+
.. warning::
331+
Just using this won't register slash command to Discord API.
332+
To register it, check :meth:`.utils.manage_commands.add_slash_command` or simply enable `sync_commands`.
333+
330334
:param cmd: Command Coroutine.
331335
:type cmd: Coroutine
332336
:param name: Name of the slash command. Default name of the coroutine.

discord_slash/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def guild(self) -> typing.Optional[discord.Guild]:
7272
return self.bot.get_guild(self.guild_id) if self.guild_id else None
7373

7474
@property
75-
def channel(self) -> typing.Optional[typing.Union[discord.abc.GuildChannel, discord.abc.PrivateChannel]]:
75+
def channel(self) -> typing.Optional[typing.Union[discord.TextChannel, discord.DMChannel]]:
7676
"""
7777
Channel instance of the command invoke.
7878

docs/faq.rst

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ If you want your commands automatically registered, set ``sync_commands`` to ``T
2727
2828
from discord_slash import SlashCommand
2929
30-
slash = SlashCommand(client, auto_register=True)
30+
slash = SlashCommand(client, sync_commands=True)
3131
3232
Or, if you prefer to have more control, you can use :mod:`.utils.manage_commands`.
3333

34-
Or, you can made requests directly to Discord API, read the `docs <https://discord.com/developers/docs/interactions/slash-commands#registering-a-command>`_.
34+
Or, you can make requests directly to Discord API, read the `docs <https://discord.com/developers/docs/interactions/slash-commands#registering-a-command>`_.
3535

3636
Add the command to your bot
3737
---------------------------
@@ -44,17 +44,9 @@ For normal slash command, use :meth:`.client.SlashCommand.slash`, and for subcom
4444
How to delete slash commands?
4545
*****************************
4646

47-
You can enable auto deletion of unused commands by setting ``auto_delete`` to ``True`` at :class:`.client.SlashCommand`.
47+
If ``sync_commands`` is set to ``True``, commands will automatically be removed as needed.
4848

49-
.. code-block:: python
50-
51-
from discord_slash import SlashCommand
52-
slash = SlashCommand(auto_delete = True)
53-
54-
.. note::
55-
This will make a request for **every** single guild your bot is in.
56-
57-
Or you can do it manually by this methods:
49+
However, if you are not using ``sync_commands`` you can do it manually by this methods:
5850

5951
* Deleting a single command with :meth:`utils.manage_commands.remove_slash_command`
6052
* Deleting all commands using :meth:`utils.manage_commands.remove_all_commands`
@@ -124,4 +116,4 @@ Pretty much anything from the discord's commands extension doesn't work, also so
124116

125117
Any more questions?
126118
*******************
127-
Join the `discord server <https://discord.gg/KkgMBVuEkx>`_ and ask in ``#questions``!
119+
Join the `discord server <https://discord.gg/KkgMBVuEkx>`_ and ask in ``#questions``!

0 commit comments

Comments
 (0)