diff options
| author | 2020-02-05 18:18:32 +0000 | |
|---|---|---|
| committer | 2020-02-05 18:18:32 +0000 | |
| commit | fc83d4fe500080088dec20e0c1eeca4ae753c2c7 (patch) | |
| tree | 3c9e99d87fce3ff76710a05527eed5a4d72632d8 /modules/alias_variables.py | |
| parent | aliases.py get.command doesn't need to be PRIORITY_URGENT (diff) | |
| signature | ||
move !alias variables in to alias_variables.py, add RNICK (random nick)
Diffstat (limited to 'modules/alias_variables.py')
| -rw-r--r-- | modules/alias_variables.py | 12 |
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 |
