From: Thorsten Date: Sat, 24 Jun 2023 11:06:47 +0000 (+0200) Subject: fix capitalization X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=078f08a7dfe10fc566f1d45f04eaff571d04c842;p=urlbot-v3.git fix capitalization --- diff --git a/distbot/plugins/didyouknow.py b/distbot/plugins/didyouknow.py index 6ee9865..ad3f285 100644 --- a/distbot/plugins/didyouknow.py +++ b/distbot/plugins/didyouknow.py @@ -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]