aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/alias_variables.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/alias_variables.py b/modules/alias_variables.py
new file mode 100644
index 00000000..6f2499a3
--- /dev/null
+++ b/modules/alias_variables.py
@@ -0,0 +1,12 @@
+import random
+from src import EventManager, ModuleManager, utils
+
+class Module(ModuleManager.BaseModule):
+ @utils.hook("get.command")
+ @utils.kwarg("priority", EventManager.PRIORITY_HIGH)
+ def get_command(self, event):
+ event["kwargs"]["NICK"] = event["user"].nickname
+ if event["is_channel"]:
+ event["kwargs"]["CHAN"] = event["target"].name
+ random_user = random.choice(list(event["target"].users))
+ event["kwargs"]["RNICK"] = random_user.nickname