44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
from src import ModuleManager, Utils
|
|
|
|
class Module(ModuleManager.BaseModule):
|
|
@Utils.hook("received.command.changenickname", min_args=1)
|
|
def change_nickname(self, event):
|
|
"""
|
|
:help: Change my nickname
|
|
:usage: <nickname>
|
|
:permission: changenickname
|
|
"""
|
|
nickname = event["args_split"][0]
|
|
event["server"].send_nick(nickname)
|
|
|
|
@Utils.hook("received.command.raw", min_args=1)
|
|
def raw(self, event):
|
|
"""
|
|
:help: Send a line of raw IRC data
|
|
:usage: <raw line>
|
|
:permission: raw
|
|
"""
|
|
event["server"].send(event["args"])
|
|
|
|
@Utils.hook("received.command.part")
|
|
def part(self, event):
|
|
"""
|
|
:help: Part from the current or given channel
|
|
:usage: [channel]
|
|
:permission: part
|
|
"""
|
|
if event["args"]:
|
|
target = event["args_split"][0]
|
|
elif event["is_channel"]:
|
|
target = event["target"].name
|
|
else:
|
|
event["stderr"].write("No channel provided")
|
|
event["server"].send_part(target)
|
|
|
|
@Utils.hook("received.command.reconnect")
|
|
def reconnect(self, event):
|
|
"""
|
|
:help: Reconnect to the current network
|
|
:permission: reconnect
|
|
"""
|
|
event["server"].send_quit("Reconnecting")
|