Add !reconnect in admin.py
This commit is contained in:
parent
d528656ba5
commit
b64e0078d3
1 changed files with 12 additions and 9 deletions
|
@ -3,17 +3,17 @@
|
||||||
class Module(object):
|
class Module(object):
|
||||||
def __init__(self, bot, events, exports):
|
def __init__(self, bot, events, exports):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
events.on("received").on("command").on("changenickname"
|
events.on("received.command.changenickname").hook(
|
||||||
).hook(self.change_nickname, permission="changenickname",
|
self.change_nickname, permission="changenickname",
|
||||||
min_args=1, help="Change my nickname", usage="<nickname>")
|
min_args=1, help="Change my nickname", usage="<nickname>")
|
||||||
events.on("received").on("command").on("raw"
|
events.on("received.command.raw").hook(self.raw,
|
||||||
).hook(self.raw, permission="raw", min_args=1,
|
permission="raw", min_args=1, usage="<raw line>",
|
||||||
help="Send a raw IRC line through the bot",
|
help="Send a raw IRC line through the bot")
|
||||||
usage="<raw line>")
|
events.on("received.command.part").hook(self.part,
|
||||||
events.on("received").on("command").on("part"
|
permission="part", min_args=1, help="Part from a channel",
|
||||||
).hook(self.part, permission="part", min_args=1,
|
|
||||||
help="Part from a channel",
|
|
||||||
usage="<#channel>")
|
usage="<#channel>")
|
||||||
|
events.on("received.command.reconnect").hook(self.reconnect,
|
||||||
|
permission="reconnect", help="Reconnect from this network")
|
||||||
|
|
||||||
def change_nickname(self, event):
|
def change_nickname(self, event):
|
||||||
nickname = event["args_split"][0]
|
nickname = event["args_split"][0]
|
||||||
|
@ -24,3 +24,6 @@ class Module(object):
|
||||||
|
|
||||||
def part(self, event):
|
def part(self, event):
|
||||||
event["server"].send_part(event["args_split"][0])
|
event["server"].send_part(event["args_split"][0])
|
||||||
|
|
||||||
|
def reconnect(self, event):
|
||||||
|
event["server"].send_quit("Reconnecting")
|
||||||
|
|
Loading…
Reference in a new issue