2018-08-31 09:51:47 +00:00
|
|
|
|
|
|
|
|
2016-05-17 15:14:23 +00:00
|
|
|
class Module(object):
|
2018-08-31 11:55:52 +00:00
|
|
|
def __init__(self, bot, events):
|
2016-05-17 15:14:23 +00:00
|
|
|
self.bot = bot
|
2018-08-31 11:55:52 +00:00
|
|
|
events.on("received").on("command").on("changenickname"
|
2018-08-31 09:51:47 +00:00
|
|
|
).hook(self.change_nickname, permission="changenickname",
|
|
|
|
min_args=1, help="Change my nickname", usage="<nickname>")
|
2018-08-31 11:55:52 +00:00
|
|
|
events.on("received").on("command").on("raw"
|
2018-08-31 09:51:47 +00:00
|
|
|
).hook(self.raw, permission="raw", min_args=1,
|
|
|
|
help="Send a raw IRC line through the bot",
|
|
|
|
usage="<raw line>")
|
2018-08-31 11:55:52 +00:00
|
|
|
events.on("received").on("command").on("part"
|
2018-08-31 09:51:47 +00:00
|
|
|
).hook(self.part, permission="part", min_args=1,
|
|
|
|
help="Part from a channel",
|
|
|
|
usage="<#channel>")
|
2016-05-17 15:14:23 +00:00
|
|
|
|
|
|
|
def change_nickname(self, event):
|
|
|
|
nickname = event["args_split"][0]
|
|
|
|
event["server"].send_nick(nickname)
|
|
|
|
|
|
|
|
def raw(self, event):
|
|
|
|
event["server"].send(event["args"])
|
2016-06-24 08:17:27 +00:00
|
|
|
|
|
|
|
def part(self, event):
|
|
|
|
event["server"].send_part(event["args_split"][0])
|