From 59c8273820097f765483ffd7ea94439441728997 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 17 May 2012 07:32:48 +1200 Subject: [PATCH] Tweaked code, moved admins back to admins.py, moved channels to info.py --- plugins/admin.py | 10 +++++++--- plugins/info.py | 13 +++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/plugins/admin.py b/plugins/admin.py index c858b03..9adcac9 100755 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -41,9 +41,13 @@ def deladmin(inp, notice=None, bot=None, config=None): @hook.command(autohelp=False) -def channels(inp, conn=None): - "channels -- Lists the channels that the bot is in." - return "I am in these channels: %s" % ", ".join(conn.channels) +def admins(inp, notice=None, bot=None): + "admins -- Lists bot's admins." + if bot.config["admins"]: + notice("Admins are: %s." % ", ".join(bot.config["admins"])) + else: + notice("There are no users with admin powers.") + return @hook.command("quit", autohelp=False, adminonly=True) diff --git a/plugins/info.py b/plugins/info.py index b19c9e6..40fd35f 100644 --- a/plugins/info.py +++ b/plugins/info.py @@ -1,16 +1,13 @@ from util import hook + @hook.command(autohelp=False) -def admins(inp, notice=None, bot=None): - "admins -- Lists bot's admins." - if bot.config["admins"]: - notice("Admins are: %s." % ", ".join(bot.config["admins"])) - else: - notice("No users are admins!") - return +def channels(inp, conn=None): + "channels -- Lists the channels that the bot is in." + return "I am in these channels: %s" % ", ".join(conn.channels) @hook.command(autohelp=False) def prefix(inp, notice=False, conn=False): "prefix -- Shows the bot's command prefix" - notice("The prefix is: \"%s\"" % conn.conf["command_prefix"]) \ No newline at end of file + notice('The command prefix is "%s"' % conn.conf["command_prefix"])