mirror of
https://github.com/skoobasteeve/telegram-moviebot.git
synced 2026-03-20 03:28:57 +00:00
more logging
This commit is contained in:
@@ -70,6 +70,7 @@ def movie_lookup(movie):
|
|||||||
if movie_id == "404":
|
if movie_id == "404":
|
||||||
tg_reply = ("I'm having trouble finding that movie\. " +
|
tg_reply = ("I'm having trouble finding that movie\. " +
|
||||||
"Check your spelling and try again\.")
|
"Check your spelling and try again\.")
|
||||||
|
logger.info('Movie not found in TMDB.')
|
||||||
similarity = 0
|
similarity = 0
|
||||||
return tg_reply, similarity
|
return tg_reply, similarity
|
||||||
|
|
||||||
@@ -77,6 +78,7 @@ def movie_lookup(movie):
|
|||||||
if sa_response == "404":
|
if sa_response == "404":
|
||||||
tg_reply = ("I'm having trouble finding that movie\. " +
|
tg_reply = ("I'm having trouble finding that movie\. " +
|
||||||
"Check your spelling and try again\.")
|
"Check your spelling and try again\.")
|
||||||
|
logger.info('Movie not found by the Streaming Availability API.')
|
||||||
similarity = 0
|
similarity = 0
|
||||||
return tg_reply, similarity
|
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,
|
context.bot.send_message(chat_id=update.effective_chat.id,
|
||||||
text=movie_info, parse_mode=ParseMode.MARKDOWN_V2)
|
text=movie_info, parse_mode=ParseMode.MARKDOWN_V2)
|
||||||
if similarity < .80 and similarity != 0:
|
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? " +
|
followup_msg = ("Not the movie you're looking for? " +
|
||||||
"Try adding '\-year' followed by the release year after the title\.")
|
"Try adding '\-year' followed by the release year after the title\.")
|
||||||
context.bot.send_message(chat_id=update.effective_chat.id,
|
context.bot.send_message(chat_id=update.effective_chat.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user