First pass at supporting user apps

Co-authored-by: red <red@kalab.sk>
Co-authored-by: Vioshim <63890837+Vioshim@users.noreply.github.com>
This commit is contained in:
Danny
2024-05-04 23:25:01 -04:00
committed by GitHub
parent 2892401992
commit 2e2f51fd5c
19 changed files with 920 additions and 52 deletions

View File

@ -653,6 +653,8 @@ class HybridGroup(Group[CogT, P, T]):
guild_only = getattr(self.callback, '__discord_app_commands_guild_only__', False)
default_permissions = getattr(self.callback, '__discord_app_commands_default_permissions__', None)
nsfw = getattr(self.callback, '__discord_app_commands_is_nsfw__', False)
contexts = getattr(self.callback, '__discord_app_commands_contexts__', MISSING)
installs = getattr(self.callback, '__discord_app_commands_installation_types__', MISSING)
self.app_command = app_commands.Group(
name=self._locale_name or self.name,
description=self._locale_description or self.description or self.short_doc or '',
@ -660,6 +662,8 @@ class HybridGroup(Group[CogT, P, T]):
guild_only=guild_only,
default_permissions=default_permissions,
nsfw=nsfw,
allowed_installs=installs,
allowed_contexts=contexts,
)
# This prevents the group from re-adding the command at __init__