From fc83d4fe500080088dec20e0c1eeca4ae753c2c7 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 5 Feb 2020 18:18:32 +0000 Subject: move !alias variables in to alias_variables.py, add RNICK (random nick) --- modules/alias_variables.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 modules/alias_variables.py (limited to 'modules/alias_variables.py') 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 -- cgit v1.3.1-10-gc9f91