Skip to content
Permalink
Browse files

Make missing *reply* commands silent, not prefix commands

  • Loading branch information...
quartata committed Dec 6, 2017
1 parent 5f48650 commit 9baa17398c46699c93163c32185d5095a2952987
Showing with 4 additions and 4 deletions.
  1. +4 −4 chatcommunicate.py
@@ -358,7 +358,9 @@ def dispatch_command(msg):
quiet_action = command_name[-1] == "-"
command_name = regex.sub(r"[[:punct:]]*$", "", command_name)

if command_name in _commands["prefix"]:
if command_name not in _commands["prefix"]:
return "No such command '{}'.".format(command_name)
else:
func, (min_arity, max_arity) = _commands["prefix"][command_name]

if max_arity == 0:
@@ -381,9 +383,7 @@ def dispatch_reply_command(msg, reply, cmd):
quiet_action = cmd[-1] == "-"
cmd = regex.sub(r"\W*$", "", cmd)

if cmd not in _commands["reply"]:
return "No such command {}.".format(cmd)
else:
if cmd in _commands["reply"]:
func, arity = _commands["reply"][cmd]

assert arity == (1, 1)

0 comments on commit 9baa173

Please sign in to comment.
You can’t perform that action at this time.