Browse Source

app_commands: commands

pull/10189/head
Soheab_ 2 weeks ago
parent
commit
a79a693868
  1. 5
      discord/app_commands/commands.py

5
discord/app_commands/commands.py

@ -61,7 +61,7 @@ from ..permissions import Permissions
from ..utils import resolve_annotation, MISSING, is_inside_class, maybe_coroutine, async_all, _shorten, _to_kebab_case from ..utils import resolve_annotation, MISSING, is_inside_class, maybe_coroutine, async_all, _shorten, _to_kebab_case
if TYPE_CHECKING: if TYPE_CHECKING:
from typing_extensions import ParamSpec, Concatenate from typing_extensions import ParamSpec, Concatenate, Unpack
from ..interactions import Interaction from ..interactions import Interaction
from ..abc import Snowflake from ..abc import Snowflake
from .namespace import Namespace from .namespace import Namespace
@ -73,6 +73,7 @@ if TYPE_CHECKING:
# However, for type hinting purposes it's unfortunately necessary for one to # However, for type hinting purposes it's unfortunately necessary for one to
# reference the other to prevent type checking errors in callbacks # reference the other to prevent type checking errors in callbacks
from discord.ext import commands from discord.ext import commands
from discord.permissions import _PermissionsKwargs
ErrorFunc = Callable[[Interaction, AppCommandError], Coroutine[Any, Any, None]] ErrorFunc = Callable[[Interaction, AppCommandError], Coroutine[Any, Any, None]]
@ -2821,7 +2822,7 @@ def allowed_installs(
return inner return inner
def default_permissions(perms_obj: Optional[Permissions] = None, /, **perms: bool) -> Callable[[T], T]: def default_permissions(perms_obj: Optional[Permissions] = None, /, **perms: Unpack[_PermissionsKwargs]) -> Callable[[T], T]:
r"""A decorator that sets the default permissions needed to execute this command. r"""A decorator that sets the default permissions needed to execute this command.
When this decorator is used, by default users must have these permissions to execute the command. When this decorator is used, by default users must have these permissions to execute the command.

Loading…
Cancel
Save