Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle --enabled argument in !edit command
  • Loading branch information
sirinoks committed Jan 5, 2022
1 parent e8accfd commit 866885e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pajbot/dispatch.py
Expand Up @@ -89,6 +89,7 @@ def edit_command(bot, source, message, event, args):

options["edited_by"] = source.id


if options is False:
bot.whisper(source, "Invalid command")
return False
Expand Down Expand Up @@ -118,6 +119,10 @@ def edit_command(bot, source, message, event, args):
old_message = ""
new_message = ""

# Handle command disable / enable
if "command_state" in options:
command.chat_enabled = options.get("command_state")

if len(action["message"]) > 0:
options["action"] = action
old_message = command.action.response
Expand Down Expand Up @@ -207,6 +212,10 @@ def edit_funccommand(bot, source, message, event, args):
)
return False

# Handle command disable / enable
if "command_state" in options:
command.chat_enabled = options.get("command_state")

if len(action["cb"]) > 0:
options["action"] = action
bot.commands.edit_command(command, **options)
Expand Down

0 comments on commit 866885e

Please sign in to comment.