From 86f329d529072d25ad96bcc1506f306b1ccd0810 Mon Sep 17 00:00:00 2001 From: chweesee <81509124+chweesee@users.noreply.github.com> Date: Mon, 6 Sep 2021 13:35:43 +0530 Subject: [PATCH 1/3] Making docs link to application-commands instead of slash-commands Replaced links i could find that redirected to https://discord.com/developers/docs/interactions/slash-commands which has been moved over to https://discord.com/developers/docs/interactions/application-commands --- docs/gettingstarted.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 3b7881e55..1fa204ce1 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -445,8 +445,8 @@ As a side-note, as of version 3.0, message/menu commands (context menus) are han .. _components: components.html .. _errors: discord_slash.error.html .. _listeners: events.html -.. _ApplicationCommandOptionType: https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype -.. _ApplicationCommandOptionChoice: https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice -.. _ApplicationCommandOption: https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption -.. _ApplicationCommandPermissionType: https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions +.. _ApplicationCommandOptionType: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type +.. _ApplicationCommandOptionChoice: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure +.. _ApplicationCommandOption: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure +.. _ApplicationCommandPermissionType: https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type .. _ApplicationCommandType: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types From 0c1ff8508b44ca32f30a291811679485dcd8908a Mon Sep 17 00:00:00 2001 From: Mathias Sven Date: Mon, 6 Sep 2021 09:34:24 +0100 Subject: [PATCH 2/3] docstrings linking to application-commands instead of slash-commands --- discord_slash/model.py | 4 ++-- discord_slash/utils/manage_commands.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/discord_slash/model.py b/discord_slash/model.py index e5504747c..d3ed83d2d 100644 --- a/discord_slash/model.py +++ b/discord_slash/model.py @@ -447,7 +447,7 @@ def __init__(self, *args, **kwargs): class SlashCommandOptionType(IntEnum): """ - Equivalent of `ApplicationCommandOptionType `_ in the Discord API. + Equivalent of `ApplicationCommandOptionType `_ in the Discord API. """ SUB_COMMAND = 1 @@ -667,7 +667,7 @@ def __eq__(self, other): class SlashCommandPermissionType(IntEnum): """ - Equivalent of `ApplicationCommandPermissionType `_ in the Discord API. + Equivalent of `ApplicationCommandPermissionType `_ in the Discord API. """ ROLE = 1 diff --git a/discord_slash/utils/manage_commands.py b/discord_slash/utils/manage_commands.py index 642beec81..229684b1c 100644 --- a/discord_slash/utils/manage_commands.py +++ b/discord_slash/utils/manage_commands.py @@ -131,7 +131,7 @@ async def get_all_guild_commands_permissions(bot_id, bot_token, guild_id): :param bot_id: User ID of the bot. :param bot_token: Token of the bot. :param guild_id: ID of the guild to get permissions. - :return: JSON Response of the request. A list of . + :return: JSON Response of the request. A list of . :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/permissions" @@ -154,7 +154,7 @@ async def get_guild_command_permissions(bot_id, bot_token, guild_id, command_id) :param bot_token: Token of the bot. :param guild_id: ID of the guild to update permissions on. :param command_id: ID for the command to update permissions on. - :return: JSON Response of the request. A list of + :return: JSON Response of the request. A list of :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/{command_id}/permissions" @@ -178,7 +178,7 @@ async def update_single_command_permissions(bot_id, bot_token, guild_id, command :param guild_id: ID of the guild to update permissions on. :param command_id: ID for the command to update permissions on. :param permissions: List of permissions for the command. - :return: JSON Response of the request. A list of + :return: JSON Response of the request. A list of :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/{command_id}/permissions" @@ -205,7 +205,7 @@ async def update_guild_commands_permissions(bot_id, bot_token, guild_id, cmd_per :param bot_token: Token of the bot. :param guild_id: ID of the guild to update permissions. :param cmd_permissions: List of dict with permissions for each commands. - :return: JSON Response of the request. A list of . + :return: JSON Response of the request. A list of . :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/permissions" @@ -246,7 +246,7 @@ def create_option( You must set the the relevant argument's function to a default argument, eg ``argname = None``. .. note:: - ``choices`` must either be a list of `option type dicts `_ + ``choices`` must either be a list of `option type dicts `_ or a list of single string values. """ if not isinstance(option_type, int) or isinstance( From 34579b780877216f9757b68abb52fe43fcc8601a Mon Sep 17 00:00:00 2001 From: Mathias Sven Date: Mon, 6 Sep 2021 09:34:24 +0100 Subject: [PATCH 3/3] docstrings linking to application-commands instead of slash-commands --- discord_slash/model.py | 4 ++-- discord_slash/utils/manage_commands.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/discord_slash/model.py b/discord_slash/model.py index e5504747c..79cbd446e 100644 --- a/discord_slash/model.py +++ b/discord_slash/model.py @@ -447,7 +447,7 @@ def __init__(self, *args, **kwargs): class SlashCommandOptionType(IntEnum): """ - Equivalent of `ApplicationCommandOptionType `_ in the Discord API. + Equivalent of `ApplicationCommandOptionType `_ in the Discord API. """ SUB_COMMAND = 1 @@ -667,7 +667,7 @@ def __eq__(self, other): class SlashCommandPermissionType(IntEnum): """ - Equivalent of `ApplicationCommandPermissionType `_ in the Discord API. + Equivalent of `ApplicationCommandPermissionType `_ in the Discord API. """ ROLE = 1 diff --git a/discord_slash/utils/manage_commands.py b/discord_slash/utils/manage_commands.py index 642beec81..0e99b501c 100644 --- a/discord_slash/utils/manage_commands.py +++ b/discord_slash/utils/manage_commands.py @@ -131,7 +131,7 @@ async def get_all_guild_commands_permissions(bot_id, bot_token, guild_id): :param bot_id: User ID of the bot. :param bot_token: Token of the bot. :param guild_id: ID of the guild to get permissions. - :return: JSON Response of the request. A list of . + :return: JSON Response of the request. A list of . :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/permissions" @@ -154,7 +154,7 @@ async def get_guild_command_permissions(bot_id, bot_token, guild_id, command_id) :param bot_token: Token of the bot. :param guild_id: ID of the guild to update permissions on. :param command_id: ID for the command to update permissions on. - :return: JSON Response of the request. A list of + :return: JSON Response of the request. A list of :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/{command_id}/permissions" @@ -178,7 +178,7 @@ async def update_single_command_permissions(bot_id, bot_token, guild_id, command :param guild_id: ID of the guild to update permissions on. :param command_id: ID for the command to update permissions on. :param permissions: List of permissions for the command. - :return: JSON Response of the request. A list of + :return: JSON Response of the request. A list of :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/{command_id}/permissions" @@ -205,7 +205,7 @@ async def update_guild_commands_permissions(bot_id, bot_token, guild_id, cmd_per :param bot_token: Token of the bot. :param guild_id: ID of the guild to update permissions. :param cmd_permissions: List of dict with permissions for each commands. - :return: JSON Response of the request. A list of . + :return: JSON Response of the request. A list of . :raises: :class:`.error.RequestFailure` - Requesting to Discord API has failed. """ url = f"https://discord.com/api/v8/applications/{bot_id}/guilds/{guild_id}/commands/permissions" @@ -246,7 +246,7 @@ def create_option( You must set the the relevant argument's function to a default argument, eg ``argname = None``. .. note:: - ``choices`` must either be a list of `option type dicts `_ + ``choices`` must either be a list of `option type dicts `_ or a list of single string values. """ if not isinstance(option_type, int) or isinstance(