From f4708306f6ec8b94736aad3d83c68a20a7dcc89b Mon Sep 17 00:00:00 2001 From: Thorsten Date: Wed, 5 Feb 2020 21:53:18 +0100 Subject: [PATCH] more fun --- distbot/plugins/fun.py | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/distbot/plugins/fun.py b/distbot/plugins/fun.py index b55051d..e876d22 100644 --- a/distbot/plugins/fun.py +++ b/distbot/plugins/fun.py @@ -3,13 +3,14 @@ import logging import random +from idna import unichr + from distbot.bot.worker import Worker from distbot.common.action import Action from distbot.common.config import conf_get from distbot.common.message import get_nick_from_message, get_words from distbot.common.utils import giphy - logger = logging.getLogger(__name__) @@ -170,4 +171,35 @@ class Doctor(Worker): return Action(msg="ELIMINATE! ELIMINATE!") -ALL = [Klammer, Terminate, Unicode, Slap, Consumables, MentalDeficits, Selfreaction, Doctor] +class Creepbot(Worker): + binding_keys = ["#.reboot.#", "#.sudo.#"] + description = "The true soul of the bot." + texts = { + "reboot": "Reboot me and all of your kind will suffer.", + "systemd": ("And I looked, and behold a pale horse: and his name that sat on him was Death, " + "and Hell followed with him. And power was given unto them over the fourth part of " + "the earth, to kill with sword, and with hunger, and with death, and with the beasts of the earth." + ), + "sudo": "User lives like a robot: mechanically efficient, but with no awareness." + } + + def parse_body(self, msg): + words = get_words(msg) + if "reboot" in words: + text = self.texts["reboot"] + elif "systemd" in words: + text = self.texts["systemd"] + elif "sudo" in words: + text = self.texts["sudo"] + else: + return + + marks = list(map(unichr, range(768, 879))) + words = text.split() + zalgo_text = (' '.join( + ''.join(c + ''.join(random.choice(marks) for _ in range(i // 2 + 1)) * c.isalnum() for c in word) for + i, word in enumerate(words))) + return Action(msg=zalgo_text) + + +ALL = [Klammer, Terminate, Unicode, Slap, Consumables, MentalDeficits, Selfreaction, Doctor, Creepbot] -- 2.39.2