|
@@ -1,10 +1,16 @@
|
|
|
import asyncio
|
|
|
from datetime import datetime
|
|
|
|
|
|
+import toml
|
|
|
+
|
|
|
import rollbot
|
|
|
from commands import config
|
|
|
|
|
|
|
|
|
+with open("secrets.toml", "r") as sfile:
|
|
|
+ secrets = toml.load(sfile)
|
|
|
+
|
|
|
+
|
|
|
class TerminalBot(rollbot.Rollbot[str]):
|
|
|
def __init__(self):
|
|
|
super().__init__(
|
|
@@ -16,7 +22,13 @@ class TerminalBot(rollbot.Rollbot[str]):
|
|
|
return ["cand1", "cand2"]
|
|
|
if key == "riddle.sleep":
|
|
|
return 10
|
|
|
- return key
|
|
|
+
|
|
|
+ cfg = secrets
|
|
|
+ for part in key.split("."):
|
|
|
+ cfg = cfg.get(part, None)
|
|
|
+ if cfg is None:
|
|
|
+ return None
|
|
|
+ return cfg
|
|
|
|
|
|
def parse(self, raw):
|
|
|
return rollbot.Message(
|