diff --git a/interactions/client/bot.py b/interactions/client/bot.py index 480ba068e..8a5aaab5a 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -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 @@ -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 """ @@ -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( @@ -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): diff --git a/interactions/client/models/command.py b/interactions/client/models/command.py index c92d3cabf..5f486c13f 100644 --- a/interactions/client/models/command.py +++ b/interactions/client/models/command.py @@ -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. @@ -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)