From b4ebe4e02b5162106c7ed361bf1c53d681156e21 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Tue, 19 Jul 2011 22:50:52 -0500 Subject: [PATCH] added !admins --- wolfgame.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/wolfgame.py b/wolfgame.py index 5b86214..e2d4c22 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -1894,4 +1894,27 @@ def help2(cli, nick, chan, rest): @hook("invite", raw_nick = False, admin_only = True) def on_invite(cli, nick, something, chan): cli.join(chan) + + + +@cmd("admins") +def show_admins(cli, nick, chan, rest): + admins = [] + + @hook("whoreply") + def on_whoreply(cli, server, dunno, chan, dunno1, + cloak, dunno3, user, status, dunno4): + if cloak in botconfig.ADMINS and 'G' not in status and user != botconfig.NICK: + admins.append(user) + + + + @hook("endofwho") + def show(*args): + cli.msg(chan, "Available admins: "+" ".join(admins)) + + HOOKS.pop("whoreply") # todo, makes this better :( + HOOKS.pop("endofwho") + + cli.who(chan) \ No newline at end of file