Browse Source

Adding shuffle command

Kirk Trombley 4 years ago
parent
commit
196b63c296
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/plugins/simple.py

+ 10 - 1
src/plugins/simple.py

@@ -46,7 +46,7 @@ def choice(message):
 
 
 @as_plugin
-def inquire(message):
+def inquire():
     opts = "Yes", "No", "Maybe", "Perhaps", "I guess", "Probably shouldn't", "rand"
     chosen = random.choice(opts)
     if chosen == "rand":
@@ -59,3 +59,12 @@ def democracy():
     chosen = random.choice(get_secret("democracy.candidates"))
     return f"Congratulations to {chosen}, thank you all for participating in the democratic process!"
 
+
+@as_plugin
+def shuffle(message):
+    opts = list(message.args())
+    if len(opts) < 2:
+        return f"You need more things to shuffle!"
+    random.shuffle(opts)
+    fmt = "\n".join(f"{i + 1} - {v}" for i, v in enumerate(opts))
+    return "Random Order:\n" + fmt