Added test argument to say.py
This commit is contained in:
23
say.py
23
say.py
@@ -28,24 +28,31 @@ def prof_post_priv_message_display(room, nick, message):
|
|||||||
say(nick + " says " + message)
|
say(nick + " says " + message)
|
||||||
return message
|
return message
|
||||||
|
|
||||||
def _cmd_say(arg=None):
|
def _cmd_say(arg1=None, arg2=None):
|
||||||
global enabled
|
global enabled
|
||||||
if arg == "on":
|
if arg1 == "on":
|
||||||
enabled = True
|
enabled = True
|
||||||
elif arg == "off":
|
elif arg1 == "off":
|
||||||
enabled = False
|
enabled = False
|
||||||
|
elif arg1 == "test":
|
||||||
|
if arg2 == None:
|
||||||
|
prof.cons_bad_cmd_usage("/say")
|
||||||
|
else:
|
||||||
|
say(arg2)
|
||||||
else:
|
else:
|
||||||
prof.cons_show("Usage: /say on|off")
|
prof.cons_bad_cmd_usage("/say")
|
||||||
|
|
||||||
def prof_init(version, status):
|
def prof_init(version, status):
|
||||||
synopsis = [
|
synopsis = [
|
||||||
"/say on|off"
|
"/say on|off",
|
||||||
|
"/say test <message>"
|
||||||
]
|
]
|
||||||
description = "Read all messages out loud"
|
description = "Read all messages out loud"
|
||||||
args = [
|
args = [
|
||||||
[ "on|off", "Enable/disable say" ]
|
[ "on|off", "Enable/disable say" ],
|
||||||
|
[ "test <message>", "Say message" ]
|
||||||
]
|
]
|
||||||
examples = []
|
examples = []
|
||||||
|
|
||||||
prof.register_command("/say", 1, 1, synopsis, description, args, examples, _cmd_say)
|
prof.register_command("/say", 1, 2, synopsis, description, args, examples, _cmd_say)
|
||||||
prof.register_ac("/say", [ "on", "off" ])
|
prof.register_ac("/say", [ "on", "off", "test" ])
|
||||||
|
|||||||
Reference in New Issue
Block a user