add day rating feature

This commit is contained in:
2024-03-12 19:14:29 +01:00
parent 2d923df965
commit 0cdc359463
6 changed files with 80 additions and 46 deletions

View File

@@ -69,21 +69,22 @@ class MemoryHandler(BaseHandler):
matching_models = context.chat_data["kept_matches"]
chosen_match = matching_models[ind]
rating_string = f" ({models.RATING_MAPPING[chosen_match.rating]})" if chosen_match.rating else ""
message_text = f"On {chosen_match.date_pretty}{rating_string}, " \
f"{chosen_match.author} wrote: \n" \
f"{chosen_match.spoiler_text}"
if chosen_match.media_path:
# context.bot.sendPhoto()
await update.effective_message.reply_photo(
photo = chosen_match.media_path,
caption=
f"On {chosen_match.date_pretty}, "
f"{chosen_match.author} wrote: \n"
f"{chosen_match.spoiler_text}",
caption = message_text,
parse_mode=ParseMode.HTML
)
else:
await query.edit_message_text(
f"On {chosen_match.date_pretty}, "
f"{chosen_match.author} wrote: \n"
f"{chosen_match.spoiler_text}",
message_text,
parse_mode=ParseMode.HTML
)