Tweaked code, moved admins back to admins.py, moved channels to info.py
This commit is contained in:
parent
4826df54f9
commit
59c8273820
2 changed files with 12 additions and 11 deletions
|
@ -41,9 +41,13 @@ def deladmin(inp, notice=None, bot=None, config=None):
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def channels(inp, conn=None):
|
def admins(inp, notice=None, bot=None):
|
||||||
"channels -- Lists the channels that the bot is in."
|
"admins -- Lists bot's admins."
|
||||||
return "I am in these channels: %s" % ", ".join(conn.channels)
|
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)
|
@hook.command("quit", autohelp=False, adminonly=True)
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
from util import hook
|
from util import hook
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def admins(inp, notice=None, bot=None):
|
def channels(inp, conn=None):
|
||||||
"admins -- Lists bot's admins."
|
"channels -- Lists the channels that the bot is in."
|
||||||
if bot.config["admins"]:
|
return "I am in these channels: %s" % ", ".join(conn.channels)
|
||||||
notice("Admins are: %s." % ", ".join(bot.config["admins"]))
|
|
||||||
else:
|
|
||||||
notice("No users are admins!")
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def prefix(inp, notice=False, conn=False):
|
def prefix(inp, notice=False, conn=False):
|
||||||
"prefix -- Shows the bot's command prefix"
|
"prefix -- Shows the bot's command prefix"
|
||||||
notice("The prefix is: \"%s\"" % conn.conf["command_prefix"])
|
notice('The command prefix is "%s"' % conn.conf["command_prefix"])
|
||||||
|
|
Reference in a new issue