From 58c12ebae84d057576db8d97ddd075bc4aeeb1e0 Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Sun, 15 Mar 2020 19:28:02 +0100 Subject: [PATCH] apod split messages for better irc support --- modules/apod.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/apod.py b/modules/apod.py index 87394fd..922a2e8 100644 --- a/modules/apod.py +++ b/modules/apod.py @@ -88,7 +88,8 @@ 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"title: {apod.title}\n\nexplanation:\n{apod.explanation}\n\nurl: {apod.url}") + await bot.send_text(room, f"{apod.title}") + await bot.send_text(room, f"explanation: {apod.explanation} date: {apod.date} 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 @@ -102,7 +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, apod.__str__()) + 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}") else: await bot.send_text(room, "sorry. something went wrong uploading the image to matrix server :(")