diff --git a/bot.py b/bot.py index 828ed1b..e636bcc 100644 --- a/bot.py +++ b/bot.py @@ -24,10 +24,8 @@ class MinerbotPhoenix(teambot.Handler): args = message[len(PREFIX):].split(" ") cmd = args.pop(0).lower() self.cmd = cmd -# print(cmd,args,hasattr(self,"on_{}".format(cmd))) if cmd in plugin.cmds: try: -# getattr(self,"on_{}".format(cmd))(channel,nick,*args) plugin.cmds[cmd](self,channel,nick,*args) except ValueError: self.say(channel,"Usage: {}{} {}".format(PREFIX,cmd,HELP.get(cmd,""))) @@ -36,10 +34,6 @@ class MinerbotPhoenix(teambot.Handler): self.say(channel,"ACCESS VIOLATION: "+traceback.format_exception_only(errcls,err)[0].strip()) print("On command `{}{} {}` by {}:".format(PREFIX,cmd," ".join(args),self.event.source)) traceback.print_exc() - def on_admin(self,channel,nick,subcmd,*args): - if not self.is_admin: return - if subcmd=="down": - self._bot.die("Stopping...") def on_rollcall(self,channel,nick,*a): self.say(channel,nick+": Hey! I'm minerbot! Commands: !mbtilde, !note, !backronym, !kwam, !su, !minerbot2src") def on_mbtilde(self,channel,nick,subcmd,*args): diff --git a/plugins/admin.py b/plugins/admin.py new file mode 100644 index 0000000..0d3e1af --- /dev/null +++ b/plugins/admin.py @@ -0,0 +1,7 @@ +import plugin + +@plugin.command("admin","GO AWAY YOU DINKLEBERG") +def admin(bot,channel,nick,subcmd,*args): + if not bot.is_admin: return + if subcmd=="down": + bot._bot.die("Stopping...") diff --git a/plugins/test.py b/plugins/test.py deleted file mode 100644 index 041ad72..0000000 --- a/plugins/test.py +++ /dev/null @@ -1,5 +0,0 @@ -import plugin - -@plugin.command("test","Just a test") -def test(bot,channel,nick,*args): - print(bot,channel,nick,*args)