Add !reconnect in admin.py

This commit is contained in:
jesopo 2018-09-03 18:21:13 +01:00
parent d528656ba5
commit b64e0078d3

View file

@ -3,17 +3,17 @@
class Module(object):
def __init__(self, bot, events, exports):
self.bot = bot
events.on("received").on("command").on("changenickname"
).hook(self.change_nickname, permission="changenickname",
events.on("received.command.changenickname").hook(
self.change_nickname, permission="changenickname",
min_args=1, help="Change my nickname", usage="<nickname>")
events.on("received").on("command").on("raw"
).hook(self.raw, permission="raw", min_args=1,
help="Send a raw IRC line through the bot",
usage="<raw line>")
events.on("received").on("command").on("part"
).hook(self.part, permission="part", min_args=1,
help="Part from a channel",
events.on("received.command.raw").hook(self.raw,
permission="raw", min_args=1, usage="<raw line>",
help="Send a raw IRC line through the bot")
events.on("received.command.part").hook(self.part,
permission="part", min_args=1, help="Part from a channel",
usage="<#channel>")
events.on("received.command.reconnect").hook(self.reconnect,
permission="reconnect", help="Reconnect from this network")
def change_nickname(self, event):
nickname = event["args_split"][0]
@ -24,3 +24,6 @@ class Module(object):
def part(self, event):
event["server"].send_part(event["args_split"][0])
def reconnect(self, event):
event["server"].send_quit("Reconnecting")