]> git.aero2k.de Git - urlbot-v3.git/commitdiff
trollolo
authorThorsten <mail@aero2k.de>
Sat, 29 Feb 2020 11:14:18 +0000 (12:14 +0100)
committerThorsten <mail@aero2k.de>
Sat, 29 Feb 2020 11:14:18 +0000 (12:14 +0100)
distbot/plugins/fun.py

index 34e9d5d53c72889003c58fece93b1ff26eb43156..08bd2e672e8afa90f7613036af540388744fe228 100644 (file)
@@ -2,6 +2,7 @@
 import logging
 
 import random
+import time
 
 from idna import unichr
 
@@ -173,4 +174,14 @@ class Doctor(Worker):
         return Action(msg="ELIMINATE! ELIMINATE!")
 
 
-ALL = [Klammer, Terminate, Unicode, Slap, Consumables, MentalDeficits, Selfreaction, Doctor]
+class Sick(Worker):
+    binding_keys = ["nick.#", "quoted_nick.#"]
+    description = "omg a computer virus"
+
+    def parse_body(self, msg):
+        if random.randint(0, 100) > 90:
+            time.sleep(random.randint(1, 5))
+            return Action(msg=random.choice(["/me sneezes", "*cough*"]))
+
+
+ALL = [Klammer, Terminate, Unicode, Slap, Consumables, MentalDeficits, Selfreaction, Doctor, Sick]