Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions interactions/client/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def __resolve_commands(self) -> None:
This is an internal method. Do not call it unless you know what you are doing!
"""
for cmd in self._commands:
if cmd.resolved:
if cmd.coro.__qualname__ in [_cmd.__qualname__ for _cmd in self.__command_coroutines]:
continue

cmd.listener = self._websocket._dispatch
Expand Down Expand Up @@ -555,7 +555,6 @@ def __resolve_commands(self) -> None:
self._scopes.add(cmd.scope if isinstance(cmd.scope, int) else cmd.scope.id)

self.event(coro, name=f"command_{cmd.name}")
cmd.resolved = True

async def __sync(self) -> None: # sourcery no-metrics
"""
Expand Down Expand Up @@ -1387,6 +1386,7 @@ def load(
else:
log.debug(f"Loaded extension {name}.")
self._extensions[_name] = module
del sys.modules[name]
return extension

def remove(
Expand Down Expand Up @@ -1424,7 +1424,6 @@ def remove(
self._loop.create_task(
_extension.teardown(remove_commands=remove_commands)
) # made for Extension, usable by others
del sys.modules[_name]

else:
with contextlib.suppress(AttributeError):
Expand Down
2 changes: 0 additions & 2 deletions interactions/client/models/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ class Command(DictSerializerMixin):
:ivar Dict[str, int] num_options: The dictionary of the number of options per subcommand.
:ivar Dict[str, Union[Callable[..., Awaitable], str]] autocompletions: The dictionary of autocompletions for the command.
:ivar Optional[str] recent_group: The name of the group most recently utilized.
:ivar bool resolved: Whether the command is synced. Defaults to ``False``.
:ivar Optional[Extension] extension: The extension that the command belongs to, if any.
:ivar Client client: The client that the command belongs to.
:ivar Optional[Listener] listener: The listener, used for dispatching command errors.
Expand All @@ -436,7 +435,6 @@ class Command(DictSerializerMixin):
)
recent_group: Optional[str] = field(default=None, init=False)
error_callback: Optional[Callable[..., Awaitable]] = field(default=None, init=False)
resolved: bool = field(default=False, init=False)
extension: Optional["Extension"] = field(default=None, init=False)
client: "Client" = field(default=None, init=False)
listener: Optional["Listener"] = field(default=None, init=False)
Expand Down