From c03c0e6e9a449755327f7e8c96c2f640d416f0c2 Mon Sep 17 00:00:00 2001 From: Ray Lyon Date: Sat, 23 Apr 2022 09:39:06 -0400 Subject: [PATCH] more logging --- telegram-moviebot/telegram-moviebot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram-moviebot/telegram-moviebot.py b/telegram-moviebot/telegram-moviebot.py index 4a46940..391fee5 100644 --- a/telegram-moviebot/telegram-moviebot.py +++ b/telegram-moviebot/telegram-moviebot.py @@ -70,6 +70,7 @@ def movie_lookup(movie): if movie_id == "404": tg_reply = ("I'm having trouble finding that movie\. " + "Check your spelling and try again\.") + logger.info('Movie not found in TMDB.') similarity = 0 return tg_reply, similarity @@ -77,6 +78,7 @@ def movie_lookup(movie): if sa_response == "404": tg_reply = ("I'm having trouble finding that movie\. " + "Check your spelling and try again\.") + logger.info('Movie not found by the Streaming Availability API.') similarity = 0 return tg_reply, similarity @@ -119,6 +121,7 @@ def input_movie(update: Update, context: CallbackContext): context.bot.send_message(chat_id=update.effective_chat.id, text=movie_info, parse_mode=ParseMode.MARKDOWN_V2) if similarity < .80 and similarity != 0: + logger.info("Result accuracy was below the threshold. Sending follow-up message.") followup_msg = ("Not the movie you're looking for? " + "Try adding '\-year' followed by the release year after the title\.") context.bot.send_message(chat_id=update.effective_chat.id,