From d548ebf3b8f8a70d72386d62f6e31707f76e5d95 Mon Sep 17 00:00:00 2001 From: missytake Date: Sun, 10 Dec 2023 14:46:42 +0100 Subject: [PATCH] add /help message --- src/remember_remember_bot/commands.py | 10 ++++++++++ src/remember_remember_bot/loop.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/remember_remember_bot/commands.py b/src/remember_remember_bot/commands.py index 0be7149..e187e5a 100644 --- a/src/remember_remember_bot/commands.py +++ b/src/remember_remember_bot/commands.py @@ -68,6 +68,16 @@ def store_file(msg: deltachat.Message): msg.chat.set_ephemeral_timer(timer) +def send_help(msg: deltachat.Message): + """Reply to the user with a help message.""" + help_text = """ +/start\tStart getting daily reminders. +/stop\tStop getting daily reminders. +/file\t(with an attachment) Add a list of entries which I can remind you of at specific dates. + """ + reply(msg.chat, help_text, quote=msg) + + def reply( chat: deltachat.Chat, text: str, diff --git a/src/remember_remember_bot/loop.py b/src/remember_remember_bot/loop.py index 8d6d290..9c1cf6a 100644 --- a/src/remember_remember_bot/loop.py +++ b/src/remember_remember_bot/loop.py @@ -2,7 +2,7 @@ import time import deltachat -from remember_remember_bot.commands import remind_chat, activate_chat, reply, store_file +from remember_remember_bot.commands import remind_chat, activate_chat, reply, store_file, send_help from remember_remember_bot.util import check_new_day, update_day @@ -30,4 +30,6 @@ def handle_incoming_message(msg: deltachat.Message): store_file(msg) else: activate_chat(msg) + else: + send_help(msg) msg.mark_seen()