Skip to content

Commit

Permalink
apod: prettier output for non-images
Browse files Browse the repository at this point in the history
  • Loading branch information
xPMo committed Jan 13, 2022
1 parent abe4369 commit e3e353a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/apod.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ async def send_apod(self, bot, room, uri, set_room_avatar=False):

async def send_unknown_mediatype(self, room, bot, apod):
self.logger.debug(f"unknown media_type: {apod.media_type}. sending raw information")
await bot.send_text(room, f"{apod.title}")
await bot.send_text(room, f"{apod.explanation} || date: {apod.date} || original-url: {apod.url}")
await bot.send_html(room,
f"<p><strong>{html.escape(apod.title)} ({html.escape(apod.date)})</strong>"
f"<br>(Original URL: {apod.url})</p>"
f"\n<p>{apod.explanation}</p>",
f"{apod.title} ({apod.date}) | Original URL: {apod.url}"
f"\n{apod.explanation}")

def get_settings(self):
data = super().get_settings()
Expand Down

0 comments on commit e3e353a

Please sign in to comment.