Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com>
Signed-off-by: plun1331 <plun1331@gmail.com>
  • Loading branch information
plun1331 and Dorukyum committed Jun 25, 2024
1 parent e778c58 commit ead5ffc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 6 additions & 4 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,9 +1189,11 @@ class SlashCommandGroup(ApplicationCommand):
The description localizations for this command. The values of this should be ``"locale": "description"``.
See `here <https://discord.com/developers/docs/reference#locales>`_ 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]
Expand Down Expand Up @@ -1613,9 +1615,9 @@ class ContextMenuCommand(ApplicationCommand):
The name localizations for this command. The values of this should be ``"locale": "name"``. See
`here <https://discord.com/developers/docs/reference#locales>`_ 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:
Expand Down
8 changes: 2 additions & 6 deletions examples/app_commands/slash_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit ead5ffc

Please sign in to comment.