Kirk Trombley пре 5 година
родитељ
комит
b8a787f36a
2 измењених фајлова са 17 додато и 1 уклоњено
  1. 8 1
      config/secrets.toml.template
  2. 9 0
      src/plugins/simple.py

+ 8 - 1
config/secrets.toml.template

@@ -20,4 +20,11 @@ banlist = {}
 alert_chat = ""
 
 [yell]
-endpoint = "your-yell-endpoint"
+endpoint = "your-yell-endpoint"
+
+[plex]
+host = "plex.tv"
+port = 32400
+
+[democracy]
+candidates = ["A", "B"]

+ 9 - 0
src/plugins/simple.py

@@ -2,6 +2,8 @@ import random
 
 from rollbot import as_plugin
 
+from config import get_secret
+
 
 @as_plugin
 def isadmin(message):
@@ -42,6 +44,7 @@ def choice(message):
     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"
@@ -49,3 +52,9 @@ def inquire(message):
     if chosen == "rand":
         chosen = str(random.randrange(10))
     return chosen
+
+
+@as_plugin
+def democracy():
+    chosen = random.choice(get_secret("democracy.candidates"))
+    return f"Congratulations to {chosen}, thank you all for participating in the democratic process!"