From 9e2fb2ba6ad7a58a0be22820b6ed7f1e69986004 Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Mon, 16 Mar 2020 07:37:52 +0100 Subject: [PATCH 1/2] apod send order title -> picture -> description --- modules/apod.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/apod.py b/modules/apod.py index 922a2e8..ad33c3b 100644 --- a/modules/apod.py +++ b/modules/apod.py @@ -89,7 +89,7 @@ class MatrixModule(BotModule): 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"explanation: {apod.explanation} date: {apod.date} url: {apod.url}") + await bot.send_text(room, f"{apod.explanation} || date: {apod.date} || original-url: {apod.url}") async def upload_and_send_image(self, room, bot, apod): url = apod.hdurl if apod.hdurl is not None else apod.url @@ -103,9 +103,9 @@ class MatrixModule(BotModule): if matrix_uri is not None: self.matrix_uri_cache[apod.date] = matrix_uri bot.save_settings() - await bot.send_image(room, matrix_uri, f"{apod.title} - url: {url} date: {apod.date}") await bot.send_text(room, f"{apod.title}") - await bot.send_text(room, f"explanation: {apod.explanation} date: {apod.date} url: {apod.url}") + await bot.send_image(room, matrix_uri, f"{apod.title} - url: {url} date: {apod.date}") + await bot.send_text(room, f"{apod.explanation} || date: {apod.date} || original-url: {apod.url}") else: await bot.send_text(room, "sorry. something went wrong uploading the image to matrix server :(") From fbf7932c4a706d52d03ca7e3102b2c0c67dd9e6b Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Tue, 17 Mar 2020 21:29:11 +0100 Subject: [PATCH 2/2] remove original-url from explanation. add date to title --- modules/apod.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/apod.py b/modules/apod.py index ad33c3b..d7a5541 100644 --- a/modules/apod.py +++ b/modules/apod.py @@ -103,9 +103,10 @@ class MatrixModule(BotModule): if matrix_uri is not None: self.matrix_uri_cache[apod.date] = matrix_uri bot.save_settings() - await bot.send_text(room, f"{apod.title}") - await bot.send_image(room, matrix_uri, f"{apod.title} - url: {url} date: {apod.date}") - await bot.send_text(room, f"{apod.explanation} || date: {apod.date} || original-url: {apod.url}") + await bot.send_text(room, f"{apod.title} ({apod.date})") + await bot.send_image(room, matrix_uri, f"{apod.title}") + await bot.send_text(room, f"original-url: {url}") + await bot.send_text(room, f"{apod.explanation}") else: await bot.send_text(room, "sorry. something went wrong uploading the image to matrix server :(")