|
27 | 27 | import sys
|
28 | 28 | import traceback
|
29 | 29 | import warnings
|
30 |
| -from itertools import chain |
31 | 30 | from typing import (
|
32 | 31 | TYPE_CHECKING,
|
33 | 32 | Any,
|
@@ -495,7 +494,7 @@ def get_app_command(
|
495 | 494 | # this does not get commands by ID, use (some other method) to do that
|
496 | 495 | if not isinstance(name, str):
|
497 | 496 | 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)) |
499 | 498 | if command is None:
|
500 | 499 | return None
|
501 | 500 | return command
|
@@ -947,7 +946,7 @@ async def _sync_application_commands(self) -> None:
|
947 | 946 | for guild_id, cmds in guild_cmds.items():
|
948 | 947 | current_guild_cmds = self._connection._guild_application_commands.get(guild_id, {})
|
949 | 948 | 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: |
951 | 950 | # because allow_command_deletion is disabled, we want to never delete a command, so we move the delete commands to no_changes
|
952 | 951 | diff["no_changes"] += diff["delete"]
|
953 | 952 | diff["delete"].clear()
|
@@ -1492,7 +1491,7 @@ async def process_application_commands(
|
1492 | 1491 | app_command = command
|
1493 | 1492 | break
|
1494 | 1493 | elif command.body.id is None:
|
1495 |
| - str() |
| 1494 | + ... |
1496 | 1495 | else:
|
1497 | 1496 | app_command = None
|
1498 | 1497 |
|
|
0 commit comments