2018-07-15 23:41:08 +00:00
|
|
|
import EventManager
|
2016-03-29 11:56:58 +00:00
|
|
|
|
|
|
|
class Module(object):
|
2018-08-31 11:55:52 +00:00
|
|
|
def __init__(self, bot, events):
|
|
|
|
events.on("received").on("numeric").on("001").hook(
|
2018-07-15 23:41:08 +00:00
|
|
|
self.on_connect, priority=EventManager.PRIORITY_URGENT)
|
2016-03-29 11:56:58 +00:00
|
|
|
|
|
|
|
def on_connect(self, event):
|
|
|
|
commands = event["server"].get_setting("perform", [])
|
|
|
|
for i, command in enumerate(commands):
|
|
|
|
command = command.split("%%")
|
|
|
|
for j, part in enumerate(command[:]):
|
|
|
|
command[j] = part.replace("%nick%", event["server"
|
2018-08-31 09:51:47 +00:00
|
|
|
].original_nickname)
|
2016-03-29 11:56:58 +00:00
|
|
|
command = "%".join(command)
|
|
|
|
event["server"].send(command)
|