]> git.aero2k.de Git - urlbot-v3.git/commitdiff
fix capitalization
authorThorsten <mail@aero2k.de>
Sat, 24 Jun 2023 11:06:47 +0000 (13:06 +0200)
committerThorsten <mail@aero2k.de>
Sat, 24 Jun 2023 11:06:47 +0000 (13:06 +0200)
distbot/plugins/didyouknow.py

index 6ee986557a1f0aba73e5ff2d25fd4fa8b217b38e..ad3f2852a14e2716cdce6cc4c235cfc9fdf33b45 100644 (file)
@@ -39,13 +39,13 @@ class DidYouKnow(Worker):
                 db = json.load(fd)
             except Exception as e:
                 db = {"quotes": []}
-            fact = random.choice(DB + db["quotes"])
+            fact: str = random.choice(DB + db["quotes"])
             db["quotes"].append(msg["body"])
             fd.seek(0)
             json.dump(db, fd, indent=2)
 
         answer = random.choice(self.answers)
-        return Action(msg="{} {}".format(answer, fact.capitalize() if answer.endswith(".") else fact))
+        return Action(msg="{} {}".format(answer, (fact[0].upper() + fact[1:]) if answer.endswith(".") else fact))
 
 
 ALL = [DidYouKnow]