From: Thorsten Date: Fri, 28 Feb 2020 15:55:35 +0000 (+0100) Subject: hug people X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=e5c8fe83318ed873c665f303741c5251eccacec6;p=urlbot-v3.git hug people --- 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]