Skip to content

Commit

Permalink
chore: add suggested typings
Browse files Browse the repository at this point in the history
  • Loading branch information
EQUENOS committed Sep 24, 2023
1 parent 4736dad commit 8c6bb90
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions disnake/ext/commands/interaction_bot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ def _emulate_old_app_command_remove(self, cmd_type: ApplicationCommandType, name
"Use remove_app_command instead.",
stacklevel=3,
)
bad_keys = []
bad_keys: List[AppCmdIndex] = []
for key in self.all_app_commands.keys():
if key.type is cmd_type and key.name == name:
bad_keys.append(key)

result = None
result: Optional[InvokableApplicationCommand] = None
for key in bad_keys:
cmd = self.all_app_commands.pop(key, None)
if result is None:
Expand All @@ -517,7 +517,7 @@ def remove_slash_command(self, name: str) -> Optional[InvokableSlashCommand]:
Optional[:class:`InvokableSlashCommand`]
The slash command that was removed. If the name is not valid then ``None`` is returned instead.
"""
self._emulate_old_app_command_remove(ApplicationCommandType.chat_input, name)
return self._emulate_old_app_command_remove(ApplicationCommandType.chat_input, name)

def remove_user_command(self, name: str) -> Optional[InvokableUserCommand]:
"""Removes an :class:`InvokableUserCommand` from the internal list
Expand All @@ -533,7 +533,7 @@ def remove_user_command(self, name: str) -> Optional[InvokableUserCommand]:
Optional[:class:`InvokableUserCommand`]
The user command that was removed. If the name is not valid then ``None`` is returned instead.
"""
self._emulate_old_app_command_remove(ApplicationCommandType.user, name)
return self._emulate_old_app_command_remove(ApplicationCommandType.user, name)

def remove_message_command(self, name: str) -> Optional[InvokableMessageCommand]:
"""Removes an :class:`InvokableMessageCommand` from the internal list
Expand All @@ -549,7 +549,7 @@ def remove_message_command(self, name: str) -> Optional[InvokableMessageCommand]
Optional[:class:`InvokableMessageCommand`]
The message command that was removed. If the name is not valid then ``None`` is returned instead.
"""
self._emulate_old_app_command_remove(ApplicationCommandType.message, name)
return self._emulate_old_app_command_remove(ApplicationCommandType.message, name)

def get_slash_command(
self, name: str, guild_id: Optional[int] = MISSING
Expand Down Expand Up @@ -966,8 +966,8 @@ def decorator(
def _ordered_unsynced_commands(
self,
) -> Tuple[List[ApplicationCommand], Dict[int, List[ApplicationCommand]]]:
global_cmds = []
guilds = {}
global_cmds: List[ApplicationCommand] = []
guilds: Dict[int, List[ApplicationCommand]] = {}

for key, cmd in self.all_app_commands.items():
if not cmd.auto_sync:
Expand Down

0 comments on commit 8c6bb90

Please sign in to comment.