diff options
| author | 2016-03-29 12:56:58 +0100 | |
|---|---|---|
| committer | 2016-03-29 12:56:58 +0100 | |
| commit | f943d63098a50746f4e470e403a991a4d9713030 (patch) | |
| tree | deeb98058917d0155227211d72576f0cbab28d3f /modules/perform.py | |
| parent | Initial commit (diff) | |
first commit.
Diffstat (limited to 'modules/perform.py')
| -rw-r--r-- | modules/perform.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/perform.py b/modules/perform.py new file mode 100644 index 00000000..c22b8b52 --- /dev/null +++ b/modules/perform.py @@ -0,0 +1,16 @@ + + +class Module(object): + def __init__(self, bot): + bot.events.on("received").on("numeric").on("001").hook( + self.on_connect) + + 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" + ].nickname) + command = "%".join(command) + event["server"].send(command) |
