From ead5ffcdbcf51f5b84c4f72006b52b54c79e8aa5 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Tue, 25 Jun 2024 14:05:30 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: plun1331 --- discord/commands/core.py | 10 ++++++---- examples/app_commands/slash_users.py | 8 ++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/discord/commands/core.py b/discord/commands/core.py index 14e3428038..7b83d074ce 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -1189,9 +1189,11 @@ class SlashCommandGroup(ApplicationCommand): The description localizations for this command. The values of this should be ``"locale": "description"``. See `here `_ for a list of valid locales. integration_types: Set[:class:`IntegrationType`] - The type of installation this command should be available to. For instance, if set to :attr:`IntegrationType.user_install`, the command will only be available to users with the application installed on their account. Cannot be set if this is a guild command. + The type of installation this command should be available to. For instance, if set to + :attr:`IntegrationType.user_install`, the command will only be available to users with + the application installed on their account. Unapplicable for guild commands. contexts: Set[:class:`InteractionContextType`] - The location where this command can be used. Cannot be set if this is a guild command. + The location where this command can be used. Unapplicable for guild commands. """ __initial_commands__: list[SlashCommand | SlashCommandGroup] @@ -1613,9 +1615,9 @@ class ContextMenuCommand(ApplicationCommand): The name localizations for this command. The values of this should be ``"locale": "name"``. See `here `_ for a list of valid locales. integration_types: Set[:class:`IntegrationType`] - The installation contexts where this command is available. Cannot be set if this is a guild command. + The installation contexts where this command is available. Unapplicable for guild commands. contexts: Set[:class:`InteractionContextType`] - The interaction contexts where this command is available. Cannot be set if this is a guild command. + The interaction contexts where this command is available. Unapplicable for guild commands. """ def __new__(cls, *args, **kwargs) -> ContextMenuCommand: diff --git a/examples/app_commands/slash_users.py b/examples/app_commands/slash_users.py index f5311fcb5e..73c32cfbad 100644 --- a/examples/app_commands/slash_users.py +++ b/examples/app_commands/slash_users.py @@ -26,12 +26,8 @@ async def say_hello(ctx: discord.ApplicationContext): await ctx.respond("Hello!") -""" -If a bot is not installed to a guild and the guild has more than 25 members, -the response will always be ephemeral. - -This is a Discord limitation and is subject to change. -""" +# If a bot is not installed to a guild and the channel has the `USE_EXTERNAL_APPS` +# permission disabled, the response will always be ephemeral. bot.run("TOKEN")