From 091cfe846960c294a08651f7c76de775b35ba93c Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Sun, 19 Feb 2012 15:20:25 +1300 Subject: [PATCH] Added .act to the admin commands --- plugins/admin.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/admin.py b/plugins/admin.py index 3075998..f817f1d 100644 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -105,6 +105,27 @@ def say(inp, input=None, notice=None): out = "PRIVMSG " + input.chan + " :" + message input.conn.send(out) +@hook.command +def act(inp, input=None, notice=None): + ".act [channel] -- makes the bot act in [channel]. if [channel] is blank the bot will act the in the channel the command was used in." + if input.nick not in input.bot.config["admins"]: + notice("Only bot admins can use this command!") + return + stuff = inp.split(" ") + if stuff[0][0] == "#": + message = "" + for x in stuff[1:]: + message = message + x + " " + message = message[:-1] + out = "PRIVMSG " + stuff[0] + " :\x01ACTION " + message + "\x01" + else: + message = "" + for x in stuff[0:]: + message = message + x + " " + message = message[:-1] + out = "PRIVMSG " + input.chan + " :\x01ACTION " + message + "\x01" + input.conn.send(out) + @hook.command def topic(inp, input=None, notice=None): ".topic [channel] -- change the topic of a channel"