From dd671d54ef012370022237ca8cfb62a648cea3bd Mon Sep 17 00:00:00 2001 From: Lorenzo Dentis Date: Sun, 15 Oct 2023 21:48:11 +0200 Subject: [PATCH 1/3] feat: wrote reply linking to repo --- bot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 695ac5c..6d270f1 100644 --- a/bot.py +++ b/bot.py @@ -238,6 +238,13 @@ def user_has_role(user: User, accepted_roles: list[str]) -> bool: return True +async def reply_repo_appunti(update: Update, context: ContextTypes.DEFAULT_TYPE): + await update.message.reply_html("Puoi trovare gli appunti degli studenti qui.", + await update.message.reply_html(f"Ciao {update.message.from_user.full_name}, puoi trovare molti appunti gratuiti " + f"sulla Guida degli Studenti\n\n" + f" » Appunti", quote=True, message_thread_id=update.message.message_thread_id) From 2e24053182703324bffcec0dff75626cec872b1a Mon Sep 17 00:00:00 2001 From: Lorenzo Dentis Date: Sun, 15 Oct 2023 22:10:45 +0200 Subject: [PATCH 3/3] feat: wrote regex to match possible notes trading --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 8ecc382..feff83a 100644 --- a/bot.py +++ b/bot.py @@ -333,7 +333,7 @@ def main(api_key: str) -> None: application.add_handler(CommandHandler(["start"], command_start)) application.add_handler(CommandHandler(["rappresentanti", "rapp"], command_rappresentanti)) application.add_handler(CommandHandler(["activate"], command_activate)) - application.add_handler(MessageHandler(filters.Regex("appunti"),reply_repo_appunti)) #todo: regex + application.add_handler(MessageHandler(filters.Regex("(vendo|cerco|compro|avete|qualcuno.*ha|Vendo|Cerco|Compro|Avete|Qualcuno.*ha).*appunti.*"),reply_repo_appunti)) #may be too generic application.run_polling()