Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
onerandomusername committed Oct 21, 2022
1 parent e5c619b commit 7cec79e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions disnake/ext/commands/interaction_bot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import sys
import traceback
import warnings
from itertools import chain
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -468,7 +467,7 @@ def get_app_command(
# this does not get commands by ID, use (some other method) to do that
if not isinstance(name, str):
raise TypeError(f"Expected name to be str, not {name.__class__}")
command = self._all_app_commands.get(AppCommandMetadata(chain[0], type=type, guild_id=guild_id)) # type: ignore
command = self._all_app_commands.get(AppCommandMetadata(name, type=type, guild_id=guild_id))
if command is None:
return None
return command
Expand Down Expand Up @@ -884,7 +883,7 @@ async def _sync_application_commands(self) -> None:
for guild_id, cmds in guild_cmds.items():
current_guild_cmds = self._connection._guild_application_commands.get(guild_id, {})
diff = _app_commands_diff(cmds, current_guild_cmds.values())
if self._command_sync.allow_command_deletion:
if not self._command_sync.allow_command_deletion:
# because allow_command_deletion is disabled, we want to never delete a command, so we move the delete commands to no_changes
diff["no_changes"] += diff["delete"]
diff["delete"].clear()
Expand Down Expand Up @@ -1429,7 +1428,7 @@ async def process_application_commands(
app_command = command
break
elif command.body.id is None:
str()
...
else:
app_command = None

Expand Down

0 comments on commit 7cec79e

Please sign in to comment.