diff --git a/config.json.example b/config.json.example index 73b4c20..5b5ad70 100644 --- a/config.json.example +++ b/config.json.example @@ -93,7 +93,7 @@ "miscreactions": { "reactions": [ "stop", "king", "mmm", "ooo", "detector", "question_marks", - "repeat_letters" + "repeat_letters", "nudge" ], "rate": 0, "stop_message": "This was your last {subject}...", @@ -102,7 +102,8 @@ "detector_message": "/me grabs its {subject} detector", "detector_process": "...", "detector_pos": "OK go on...", - "detector_neg": "Halt!" + "detector_neg": "Halt!", + "nudging": "/me nudges {target}" }, "mood": { "commands": ["calm down"], diff --git a/edmond/plugins/misc_reactions.py b/edmond/plugins/misc_reactions.py index 5b6c252..eacc370 100644 --- a/edmond/plugins/misc_reactions.py +++ b/edmond/plugins/misc_reactions.py @@ -1,5 +1,7 @@ import random +from irc.client import NickMask + from edmond.plugin import Plugin from edmond.utils import proc @@ -27,6 +29,7 @@ class MiscReactionsPlugin(Plugin): "ooo", "detector", "repeat_letters", + "nudge", ]) def __init__(self, bot): @@ -162,3 +165,11 @@ class MiscReactionsPlugin(Plugin): question_mark = self.config["question_mark"] reply = f"{word}{question_mark}" self.bot.say(event.target, reply) + + def react_with_nudge(self, event): + """Nudge the last person who talked (unsure how or why).""" + nick = NickMask(event.source).nick + reply = self.config.get("nudging") + if reply is None: + return + self.bot.say(event.target, reply.format(target=nick))