Fix slash_command and normal_command bools
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user