From 3db5550fb8d176fdf6fa37d917920ebbcd84dc74 Mon Sep 17 00:00:00 2001 From: missytake Date: Fri, 29 Aug 2025 11:29:14 +0200 Subject: [PATCH] allow commands to be mixed-case --- src/remember_remember_bot/loop.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/remember_remember_bot/loop.py b/src/remember_remember_bot/loop.py index ce3b580..25912ee 100644 --- a/src/remember_remember_bot/loop.py +++ b/src/remember_remember_bot/loop.py @@ -26,25 +26,25 @@ def loop(ac: deltachat.Account): def handle_incoming_message(msg: deltachat.Message, ac: deltachat.Account): admin_chat = get_admin_chat(ac) - if msg.text.startswith("/start") and msg.chat.is_protected(): + if msg.text.lower().startswith("/start") and msg.chat.is_protected(): reply(msg.chat, set_admin_chat(msg.chat)) admin_chat.send_text( f"I will forward appropriate messages to {msg.chat.get_name()} now." ) set_admin_chat(msg.chat) elif msg.chat == admin_chat: - if msg.text.startswith("/add"): + if msg.text.lower().startswith("/add"): add_keywords(msg) repl = f"Stored {', '.join(list_keywords(ac))} as keywords." reply(msg.chat, repl, quote=msg) - elif msg.text.startswith("/list"): + elif msg.text.lower().startswith("/list"): repl = f"The current keywords are: {', '.join(list_keywords(ac))}" reply(msg.chat, repl, quote=msg) - elif msg.text.startswith("/remove"): + elif msg.text.lower().startswith("/remove"): reply(msg.chat, rm_keyword(msg)) - elif msg.text.startswith("/help"): + elif msg.text.lower().startswith("/help"): send_help(msg) - elif msg.text.startswith("/stop"): + elif msg.text.lower().startswith("/stop"): set_admin_chat(msg.account.get_chat_by_id(0)) else: check_and_forward(msg, admin_chat)