about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-02-18 23:31:58 -0500
committerBen Harris <ben@tilde.team>2021-02-18 23:31:58 -0500
commitaf049451872a4a79813226420da51be349f06070 (patch)
treed67930df324fc40df09a7108a2cbc6a3dc26b644
parentb140c7e5391fcbd594e293dcb688b4b561ceae2d (diff)
fix types from configparser
-rw-r--r--tracer.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tracer.py b/tracer.py
index 4b1ddfe..2b385e3 100644
--- a/tracer.py
+++ b/tracer.py
@@ -15,6 +15,9 @@ import random
 import traceback
 import tracery
 
+HELPTEXT = "helo i'm a tracery bot that makes cool things from tracery grammars in your ~/.tracery. see http://tracery.io for more info"
+REPOLINK = "https://tildegit.org/ben/tracer"
+
 DB = {}
 config = configparser.ConfigParser(
     converters={"list": lambda x: [i.strip() for i in x.split(",")]}
@@ -48,7 +51,7 @@ def load_rules(path):
 
 def populate():
     global DB
-    # DB = {}
+    DB = {}
     for p in glob.glob("/home/*/.tracery/*"):
         name, ext = os.path.splitext(p)
         name = os.path.basename(name)
@@ -122,9 +125,9 @@ def think(line):
                 if res:
                     return res
         elif words[0] == "!!source":
-            return "https://tildegit.org/ben/tracer"
+            return REPOLINK
         elif words[0] == "!botlist" or words[0] == "!!help":
-            return "helo i'm a tracery bot that makes cool things from tracery grammars in your ~/.tracery. see http://tracery.io for more info"
+            return HELPTEXT
         elif words[0][0:2] == "!!":
             print(words)
             res = generate(words[0][2:])
@@ -182,8 +185,8 @@ async def main():
     params = ConnectionParams(
         bot["nick"],
         host=bot["server"],
-        port=int(bot["port"]),
-        tls=bool(bot["tls"]),
+        port=bot.getint("port"),
+        tls=bot.getboolean("tls"),
         sasl=SASLUserPass(account["username"], account["password"]),
     )