Move nomad to mainfunctions
Also, take a list of admins from ~/minerbot.admins.
This commit is contained in:
parent
f2483d0ef0
commit
523629d518
|
@ -1,6 +1,10 @@
|
||||||
import plugin, os
|
import plugin, os
|
||||||
|
|
||||||
BOT_NICKS = ["minerobber"]
|
try:
|
||||||
|
with open(os.path.expanduser("~/minerbot.admins")) as f:
|
||||||
|
BOT_NICKS = [l.strip() for l in f if l.strip()]
|
||||||
|
except:
|
||||||
|
BOT_NICKS = ["minerobber"]
|
||||||
|
|
||||||
@plugin.listener("admin")
|
@plugin.listener("admin")
|
||||||
def admin(bot,channel,nick,msg):
|
def admin(bot,channel,nick,msg):
|
||||||
|
@ -59,3 +63,15 @@ def minerbotsrc(bot,channel,nick,*args):
|
||||||
@plugin.command("minerbothelp")
|
@plugin.command("minerbothelp")
|
||||||
def help(bot,channel,nick,*args):
|
def help(bot,channel,nick,*args):
|
||||||
bot.say(channel,nick+": currently loaded commands: {}".format(", ".join("!"+cmd for cmd in plugin.cmds.keys())))
|
bot.say(channel,nick+": currently loaded commands: {}".format(", ".join("!"+cmd for cmd in plugin.cmds.keys())))
|
||||||
|
|
||||||
|
@plugin.command("minomad","<GO AWAY DINKLEBERG>")
|
||||||
|
def minomad(bot,channel,nick,*args):
|
||||||
|
if nick not in BOT_NICKS: return
|
||||||
|
args = list(args)
|
||||||
|
command = args.pop(0)
|
||||||
|
if command == "join":
|
||||||
|
for channel in args:
|
||||||
|
bot._bot.conn.join(channel)
|
||||||
|
elif command == "part":
|
||||||
|
for channel in args:
|
||||||
|
bot._bot.conn.part(channel,"Leaving...")
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
import plugin
|
|
||||||
|
|
||||||
@plugin.command("minomad","<GO AWAY DINKLEBERG>")
|
|
||||||
def minomad(bot,channel,nick,*args):
|
|
||||||
if not bot.is_admin: return
|
|
||||||
args = list(args)
|
|
||||||
command = args.pop(0)
|
|
||||||
if command == "join":
|
|
||||||
for channel in args:
|
|
||||||
bot._bot.conn.join(channel)
|
|
||||||
elif command == "part":
|
|
||||||
for channel in args:
|
|
||||||
bot._bot.conn.part(channel,"Leaving...")
|
|
Loading…
Reference in New Issue