Explorar o código

Merge branch 'master' of iramo94/ivan into master

kirkleon %!s(int64=5) %!d(string=hai) anos
pai
achega
a181ee663c
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      src/plugins/simple.py

+ 8 - 0
src/plugins/simple.py

@@ -41,3 +41,11 @@ def choice(message):
     opts = list(message.args())
     chosen = random.choice(opts)
     return f"Randomly chose {chosen} from {len(opts)} options"
+
+@as_plugin
+def inquire(message):
+    opts = "Yes", "No", "Maybe", "Perhaps", "I guess", "Probably shouldn't", "rand"
+    chosen = random.choice(opts)
+    if chosen == "rand":
+        chosen = str(random.randrange(10))
+    return chosen