From 2d2ea2fc3a8efa0801624c4a47e8bdc8c8078e56 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 30 Apr 2019 11:51:43 +0100 Subject: [PATCH] Added pronouns.py --- modules/pronouns.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/pronouns.py 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)