added admin.py, for admin-type things.
This commit is contained in:
parent
f06033483f
commit
d042f0dc4a
1 changed files with 19 additions and 0 deletions
19
modules/admin.py
Normal file
19
modules/admin.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
|
||||
class Module(object):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
bot.events.on("received").on("command").on("changenickname"
|
||||
).hook(self.change_nickname, permission="changenickname",
|
||||
min_args=1, help="Change my nickname", usage="<nickname>")
|
||||
bot.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>")
|
||||
|
||||
def change_nickname(self, event):
|
||||
nickname = event["args_split"][0]
|
||||
event["server"].send_nick(nickname)
|
||||
|
||||
def raw(self, event):
|
||||
event["server"].send(event["args"])
|
Loading…
Reference in a new issue