Change admin auth

This commit is contained in:
minerobber 2019-02-04 21:34:45 +00:00
parent bcbcd25861
commit f2483d0ef0
1 changed files with 7 additions and 1 deletions

View File

@ -1,8 +1,10 @@
import plugin, os
BOT_NICKS = ["minerobber"]
@plugin.listener("admin")
def admin(bot,channel,nick,msg):
if not bot.is_admin: return
if nick not in BOT_NICKS: return
if not msg.startswith(bot.nick+": "): return
args = msg[len(bot.nick)+2:].split()
subcmd = args.pop(0)
@ -31,6 +33,10 @@ def admin(bot,channel,nick,msg):
elif subcmd=="pull":
subprocess.run("git pull",shell=True)
bot.load_modules()
elif subcmd=="add":
BOT_NICKS.append(args.pop(0))
elif subcmd=="del":
BOT_NICKS.remove(args.pop(0))
@plugin.listener("water_joke")
def water_joke(bot,channel,nick,msg):