add day rating feature
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user