apod split messages for better irc support
This commit is contained in:
parent
e537bbc84d
commit
58c12ebae8
|
@ -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 :(")
|
||||
|
||||
|
|
Loading…
Reference in New Issue