Move nomad to mainfunctions

Also, take a list of admins from ~/minerbot.admins.
This commit is contained in:
minerobber 2019-02-28 11:43:27 +00:00
parent f2483d0ef0
commit 523629d518
2 changed files with 17 additions and 14 deletions

View File

@ -1,6 +1,10 @@
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")
def admin(bot,channel,nick,msg):
@ -59,3 +63,15 @@ def minerbotsrc(bot,channel,nick,*args):
@plugin.command("minerbothelp")
def help(bot,channel,nick,*args):
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...")

View File

@ -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...")