Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
onerandomusername committed Aug 14, 2022
1 parent c0c3554 commit d83abf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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 @@ -27,7 +27,6 @@
import sys
import traceback
import warnings
from itertools import chain
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -495,7 +494,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 @@ -947,7 +946,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 @@ -1492,7 +1491,7 @@ async def process_application_commands(
app_command = command
break
elif command.body.id is None:
str()
...
else:
app_command = None

Expand Down
8 changes: 4 additions & 4 deletions disnake/ext/commands/slash_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ async def _call_autocompleter(
class SubCommandGroup(InvokableApplicationCommand):
"""A class that implements the protocol for a bot slash command group.
These are not created manually, instead they are created via the
decorator or functional interface.
These are not created manually, instead they are created via the
decorator or functional interface.
Attributes
----------
Expand Down Expand Up @@ -260,8 +260,8 @@ def decorator(func: CommandCallback) -> SubCommand:
class SubCommand(InvokableApplicationCommand):
"""A class that implements the protocol for a bot slash subcommand.
These are not created manually, instead they are created via the
decorator or functional interface.
These are not created manually, instead they are created via the
decorator or functional interface.
Attributes
----------
Expand Down

0 comments on commit d83abf8

Please sign in to comment.