2019-05-25 20:40:06 +00:00
|
|
|
#--depends-on commands
|
|
|
|
#--depends-on config
|
|
|
|
|
2019-04-30 10:51:43 +00:00
|
|
|
from src import ModuleManager, utils
|
|
|
|
|
2019-05-23 09:28:14 +00:00
|
|
|
@utils.export("set", {"setting": "pronouns", "help": "Set your pronouns",
|
|
|
|
"example": "she/her"})
|
2019-04-30 10:51:43 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
|
|
|
@utils.hook("received.command.pronouns")
|
|
|
|
def pronouns(self, event):
|
|
|
|
"""
|
|
|
|
:help: Get your, or someone else's, pronouns
|
|
|
|
:usage: [nickname]
|
2019-05-23 11:18:12 +00:00
|
|
|
:require_setting: pronouns
|
|
|
|
:require_setting_unless: 1
|
2019-04-30 10:51:43 +00:00
|
|
|
"""
|
|
|
|
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)
|