Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions interactions/client/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ def __resolve_commands(self) -> None:

if cmd.default_scope and self._default_scope:
cmd.scope = (
cmd.scope.extend(cmd.default_scope) if cmd.scope else self._default_scope
cmd.scope.extend(cmd.default_scope)
if isinstance(cmd.scope, list)
else self._default_scope
)

data: Union[dict, List[dict]] = cmd.full_data
Expand Down Expand Up @@ -1690,20 +1692,18 @@ def decorator(func):


@wraps(Client.message_command)
def extension_message_command(*args, **kwargs):
def decorator(func):
def extension_message_command(**kwargs) -> Callable[[Callable[..., Coroutine]], Command]:
def decorator(func) -> Command:
kwargs["type"] = ApplicationCommandType.MESSAGE
func.__command_data__ = (args, kwargs)
return func
return extension_command(**kwargs)(func)

return decorator


@wraps(Client.user_command)
def extension_user_command(*args, **kwargs):
def decorator(func):
def extension_user_command(**kwargs) -> Callable[[Callable[..., Coroutine]], Command]:
def decorator(func) -> Command:
kwargs["type"] = ApplicationCommandType.USER
func.__command_data__ = (args, kwargs)
return func
return extension_command(**kwargs)(func)

return decorator