From: Thorsten S Date: Wed, 1 May 2019 09:26:00 +0000 (+0200) Subject: stupid looking debug plugin X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=3bda80bf196ec1959340ec55a68ef6f48f43f120;p=urlbot-v3.git stupid looking debug plugin --- diff --git a/distbot/plugins/debug.py b/distbot/plugins/debug.py new file mode 100644 index 0000000..3158456 --- /dev/null +++ b/distbot/plugins/debug.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +import logging + +from distbot.common.action import Action +from distbot.common.message import get_words +from distbot.bot.worker import Worker + +logger = logging.getLogger(__name__) + + +class Echo(Worker): + binding_keys = ['nick.echo.#'] + description = "a really handsome parrot bot" + usage = "bot: echo " + + def parse_body(self, msg): + message = " ".join(get_words(msg)[1:]) + logger.debug(message) + return Action(msg=message) + + +ALL = [Echo]