From c86ac45c15e77f82462edc58646d19c07a8e7a38 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 11 Jul 2019 13:42:21 +0100 Subject: bots need snacks too --- modules/botsnack.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/botsnack.py (limited to 'modules') diff --git a/modules/botsnack.py b/modules/botsnack.py new file mode 100644 index 00000000..2add76dc --- /dev/null +++ b/modules/botsnack.py @@ -0,0 +1,19 @@ +#--depends-on commands + +import random +from src import ModuleManager, utils + +ACTIONS = [ + "cronch", + "munch", + "nom nom", + "wriggles excitedly" +] + +class Module(ModuleManager.BaseModule): + @utils.hook("received.command.botsnack") + @utils.kwarg("expect_output", False) + def botsnack(self, event): + event["target"].send_message("\x01ACTION %s\x01" % + random.choice(ACTIONS)) + -- cgit v1.3.1-10-gc9f91