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

@@ -42,23 +42,24 @@ class RandomMemoryJob():
chat_id = os.getenv("CHAT_ID")
rating_string = f" ({models.RATING_MAPPING[chosen_entry.rating]})" if chosen_entry.rating else ""
message_text = f"On {chosen_entry.date_pretty}{rating_string}, " \
f"{chosen_entry.author} wrote: \n" \
f"{chosen_entry.spoiler_text}"
if chosen_entry.media_path:
await self.bot.send_photo(
chat_id = chat_id,
photo = chosen_entry.media_path,
caption =
f"On {chosen_entry.date_pretty}, "
f"{chosen_entry.author} wrote: \n"
f"{chosen_entry.spoiler_text}",
caption = message_text,
parse_mode=ParseMode.HTML
)
else:
await self.bot.send_message(
chat_id = chat_id,
text =
f"On {chosen_entry.date_pretty}, "
f"{chosen_entry.author} wrote: \n"
f"{chosen_entry.spoiler_text}",
text = message_text,
parse_mode=ParseMode.HTML
)