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__)
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]