aboutsummaryrefslogtreecommitdiff
path: root/modules/perform.py
diff options
context:
space:
mode:
authorGravatar jesopo2016-03-29 12:56:58 +0100
committerGravatar jesopo2016-03-29 12:56:58 +0100
commitf943d63098a50746f4e470e403a991a4d9713030 (patch)
treedeeb98058917d0155227211d72576f0cbab28d3f /modules/perform.py
parentInitial commit (diff)
first commit.
Diffstat (limited to 'modules/perform.py')
-rw-r--r--modules/perform.py16
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)