Fix slash_command and normal_command bools

This commit is contained in:
Gnome
2021-09-02 12:33:48 +01:00
parent caa5f39c0f
commit 355097589a
2 changed files with 11 additions and 19 deletions

View File

@@ -1142,13 +1142,14 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
:class:`bool`
A boolean indicating if the command can be invoked.
"""
if not self.enabled or (
ctx.interaction is not None
and self.slash_command is False
) or (
ctx.interaction is None
and self.message_command is False
ctx.interaction is None and (
self.message_command is False
or (self.message_command is None and not ctx.bot.message_commands)
) or (
self.slash_command is False
or (self.slash_command is None and not ctx.bot.slash_commands)
)
):
raise DisabledCommand(f'{self.name} command is disabled')