Skip to content

Commit bb1d6c0

Browse files
authored
Fixed cmd_name parameter description. (#261)
* Fixed cmd_name parameter description. https://discord.com/developers/docs/interactions/slash-commands#registering-a-command * Changed cmd_name parameter description. * Update http.py * Fix some docs
1 parent 906e61e commit bb1d6c0

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

discord_slash/http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def remove_slash_command(self, guild_id, cmd_id):
3939
"""
4040
Sends a slash command delete request to Discord API.
4141
42-
:param guild_id: ID of the guild to add command. Pass `None` to add global command.
42+
:param guild_id: ID of the guild to remove command. Pass `None` to remove global command.
4343
:param cmd_id: ID of the command.
4444
:return: Response code of the request.
4545
"""
@@ -49,7 +49,7 @@ def get_all_commands(self, guild_id=None):
4949
"""
5050
Sends a slash command get request to Discord API for all commands.
5151
52-
:param guild_id: ID of the guild to add command. Pass `None` to add global command.
52+
:param guild_id: ID of the guild to get commands. Pass `None` to get global commands.
5353
:return: JSON Response of the request.
5454
"""
5555
return self.command_request(method="GET", guild_id=guild_id)
@@ -79,7 +79,7 @@ def add_slash_command(self, guild_id, cmd_name: str, description: str, options:
7979
Sends a slash command add request to Discord API.
8080
8181
:param guild_id: ID of the guild to add command. Pass `None` to add global command.
82-
:param cmd_name: Name of the command. Must be 3 or longer and 32 or shorter.
82+
:param cmd_name: Name of the command. Must be match the regular expression ``^[a-z0-9_-]{1,32}$``.
8383
:param description: Description of the command.
8484
:param options: List of the function.
8585
:return: JSON Response of the request.

discord_slash/utils/manage_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def add_slash_command(
1919
:param bot_id: User ID of the bot.
2020
:param bot_token: Token of the bot.
2121
:param guild_id: ID of the guild to add command. Pass `None` to add global command.
22-
:param cmd_name: Name of the command. Must be 3 or longer and 32 or shorter.
22+
:param cmd_name: Name of the command. Must match the regular expression ``^[a-z0-9_-]{1,32}$``.
2323
:param description: Description of the command.
2424
:param options: List of the function.
2525
:return: JSON Response of the request.

docs/faq.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ If you want your commands automatically registered, set ``sync_commands`` to ``T
2929
3030
slash = SlashCommand(client, sync_commands=True)
3131
32-
Or, if you prefer to have more control, you can use :mod:`.utils.manage_commands`.
32+
Or, if you want to send requests manually, you can use :class:`.http.SlashCommandRequest`.
33+
34+
Or, if you don't want to use `discord.Client`, you can use :mod:`.utils.manage_commands`.
3335

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

@@ -48,7 +50,7 @@ If ``sync_commands`` is set to ``True``, commands will automatically be removed
4850

4951
However, if you are not using ``sync_commands`` you can do it manually by this methods:
5052

51-
* Deleting a single command with :meth:`utils.manage_commands.remove_slash_command`
53+
* Deleting a single command with :meth:`.http.SlashCommandRequest.remove_slash_command` or :meth:`utils.manage_commands.remove_slash_command`
5254
* Deleting all commands using :meth:`utils.manage_commands.remove_all_commands`
5355
* Deleting all commands in a specified guild, or all global commands by :meth:`utils.manage_commands.remove_all_commands_in`
5456
* Making a HTTP request to `discord <https://discord.com/developers/docs/interactions/slash-commands#delete-global-application-command>`_

0 commit comments

Comments
 (0)