From 4b404a2b193b4637e9ccb06f1ac34e2cb133837b Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Thu, 13 Aug 2026 06:12:19 +0300 Subject: [PATCH] Fix AttributeError when ALWAYS_REPLY is None Check for None before calling .lower() to prevent crashes when the variable is unset. Closes #41 --- discordbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discordbot.py b/discordbot.py index 191d37f..37d15a2 100644 --- a/discordbot.py +++ b/discordbot.py @@ -32,7 +32,7 @@ bot.endpoint = bot.endpoint.split("/api")[0] bot.chatlog_dir = "chatlog_dir" bot.endpoint_connected = False -bot.always_reply = ALWAYS_REPLY.lower() == "t" +bot.always_reply = (ALWAYS_REPLY or "T").lower() == "t" print(f"ALWAYS_REPLY: {bot.always_reply}") bot.channel_id = CHANNEL_ID bot.num_lines_to_keep = int(CHAT_HISTORY_LINE_LIMIT)