Skip to content

Commit d83abf8

Browse files
fix some bugs
1 parent c0c3554 commit d83abf8

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

disnake/ext/commands/interaction_bot_base.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import sys
2828
import traceback
2929
import warnings
30-
from itertools import chain
3130
from typing import (
3231
TYPE_CHECKING,
3332
Any,
@@ -495,7 +494,7 @@ def get_app_command(
495494
# this does not get commands by ID, use (some other method) to do that
496495
if not isinstance(name, str):
497496
raise TypeError(f"Expected name to be str, not {name.__class__}")
498-
command = self._all_app_commands.get(AppCommandMetadata(chain[0], type=type, guild_id=guild_id)) # type: ignore
497+
command = self._all_app_commands.get(AppCommandMetadata(name, type=type, guild_id=guild_id))
499498
if command is None:
500499
return None
501500
return command
@@ -947,7 +946,7 @@ async def _sync_application_commands(self) -> None:
947946
for guild_id, cmds in guild_cmds.items():
948947
current_guild_cmds = self._connection._guild_application_commands.get(guild_id, {})
949948
diff = _app_commands_diff(cmds, current_guild_cmds.values())
950-
if self._command_sync.allow_command_deletion:
949+
if not self._command_sync.allow_command_deletion:
951950
# because allow_command_deletion is disabled, we want to never delete a command, so we move the delete commands to no_changes
952951
diff["no_changes"] += diff["delete"]
953952
diff["delete"].clear()
@@ -1492,7 +1491,7 @@ async def process_application_commands(
14921491
app_command = command
14931492
break
14941493
elif command.body.id is None:
1495-
str()
1494+
...
14961495
else:
14971496
app_command = None
14981497

disnake/ext/commands/slash_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ async def _call_autocompleter(
122122
class SubCommandGroup(InvokableApplicationCommand):
123123
"""A class that implements the protocol for a bot slash command group.
124124
125-
These are not created manually, instead they are created via the
126-
decorator or functional interface.
125+
These are not created manually, instead they are created via the
126+
decorator or functional interface.
127127
128128
Attributes
129129
----------
@@ -260,8 +260,8 @@ def decorator(func: CommandCallback) -> SubCommand:
260260
class SubCommand(InvokableApplicationCommand):
261261
"""A class that implements the protocol for a bot slash subcommand.
262262
263-
These are not created manually, instead they are created via the
264-
decorator or functional interface.
263+
These are not created manually, instead they are created via the
264+
decorator or functional interface.
265265
266266
Attributes
267267
----------

0 commit comments

Comments
 (0)