From d85d5e054f6b6f02c7ff957ca27aac4fc958065d Mon Sep 17 00:00:00 2001 From: dece Date: Mon, 2 Nov 2020 16:54:32 +0100 Subject: [PATCH] mood: add get_pissed method (unused) --- config.json.example | 3 ++- edmond/plugins/mood.py | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.json.example b/config.json.example index 06a8da7..23b33d3 100644 --- a/config.json.example +++ b/config.json.example @@ -43,7 +43,8 @@ "calm": "Fine!", "pissed": "Pissed off..." }, - "calmed_message": "I'm calm now." + "calmed_message": "I'm calm now.", + "pissed_message": "I'm pissed off now..." }, "notes": { "commands": ["note down", "notes"], diff --git a/edmond/plugins/mood.py b/edmond/plugins/mood.py index 54b5366..587d2f0 100644 --- a/edmond/plugins/mood.py +++ b/edmond/plugins/mood.py @@ -15,6 +15,9 @@ class MoodPlugin(Plugin): This plugin exposes the runtime value `mood` (Mood) which can be used to act differently upon some actions according to the bot current mood. + + There is only one question available: what's the bot mood? Multiple + questions in the `questions` list is equivalent to using aliases. """ REQUIRED_CONFIGS = [ @@ -55,6 +58,12 @@ class MoodPlugin(Plugin): self.set_runtime_value("mood", Mood.CALM) self.bot.say(target, self.config["calmed_message"]) + def get_pissed(self, target): + if self.mood == Mood.PISSED: + return + self.set_runtime_value("mood", Mood.PISSED) + self.bot.say(target, self.config["pissed_message"]) + def say_mood(self, target): answer = self.config["answer"].get(self.mood.value) if answer: