From e5c8fe83318ed873c665f303741c5251eccacec6 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 28 Feb 2020 16:55:35 +0100 Subject: [PATCH] hug people --- distbot/plugins/fun.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/distbot/plugins/fun.py b/distbot/plugins/fun.py index fedea95..75b97cc 100644 --- a/distbot/plugins/fun.py +++ b/distbot/plugins/fun.py @@ -66,6 +66,19 @@ class Slap(Worker): return Action(msg='/me slaps {}'.format(slapped)) +class Hug(Worker): + binding_keys = ["nick.hug.#"] + description = "hugs people" + + def parse_body(self, msg): + sender = get_nick_from_message(msg) + if len(self.used_channel) > 2: + slapped = " ".join(self.used_channel[2:]) + else: + slapped = sender + return Action(msg='/me hugs {}'.format(slapped)) + + class Consumables(Worker): description = "Om nom nom" usage = "bot: cake/coffee/kaffee/keks/schnitzel/frühstück [please]" @@ -171,4 +184,4 @@ class Doctor(Worker): return Action(msg="ELIMINATE! ELIMINATE!") -ALL = [Klammer, Terminate, Unicode, Slap, Consumables, MentalDeficits, Selfreaction, Doctor] +ALL = [Klammer, Terminate, Unicode, Hug, Slap, Consumables, MentalDeficits, Selfreaction, Doctor] -- 2.39.2