diff options
| author | 2019-04-30 11:51:43 +0100 | |
|---|---|---|
| committer | 2019-04-30 11:51:43 +0100 | |
| commit | 2d2ea2fc3a8efa0801624c4a47e8bdc8c8078e56 (patch) | |
| tree | ae39a5fbfe6bfd8d6daea94c397d22a9e6ddd2a1 | |
| parent | resume.py should be using IRCServer.send_raw (diff) | |
| signature | ||
Added pronouns.py
| -rw-r--r-- | modules/pronouns.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/pronouns.py b/modules/pronouns.py new file mode 100644 index 00000000..be6d5f06 --- /dev/null +++ b/modules/pronouns.py @@ -0,0 +1,22 @@ +from src import ModuleManager, utils + +@utils.export("set", {"setting": "pronouns", "help": "Set your pronouns"}) +class Module(ModuleManager.BaseModule): + @utils.hook("received.command.pronouns") + def pronouns(self, event): + """ + :help: Get your, or someone else's, pronouns + :usage: [nickname] + """ + target_user = event["user"] + if event["args"]: + target_user = event["server"].get_user(event["args_split"][0]) + + pronouns = target_user.get_setting("pronouns", None) + + if not pronouns == None: + event["stdout"].write("Pronouns for %s: %s" % + (target_user.nickname, pronouns)) + else: + event["stderr"].write("No pronouns set for %s" % + target_user.nickname) |
