Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reject run for disabled command
  • Loading branch information
sirinoks committed Jan 5, 2022
1 parent 866885e commit 1354c68
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pajbot/models/command.py
Expand Up @@ -388,6 +388,15 @@ def run(self, bot, source, message, event={}, args={}, whisper=False):

if not self.can_run_command(source, whisper):
return False

# The command has been disabled
if not self.chat_enabled:
if self.notify_on_error:
bot.whisper(
source,
f"This command is disabled.",
)
return False

cd_modifier = 0.2 if source.level >= 500 or source.moderator is True else 1.0

Expand Down

0 comments on commit 1354c68

Please sign in to comment.