From c2d2d2543f39f5eaba79cd316c883427ae765d85 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 19 May 2020 18:14:26 +0200 Subject: [PATCH] publish: 5.8.9 --- pyproject.toml | 2 +- royalnet/commands/commanddata.py | 2 +- royalnet/serf/discord/discordserf.py | 4 ++-- royalnet/serf/telegram/telegramserf.py | 4 ++-- royalnet/version.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 22e6c084..6fd3f20b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ [tool.poetry] name = "royalnet" - version = "5.8.8" + version = "5.8.9" description = "A multipurpose bot and web framework" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalnet/commands/commanddata.py b/royalnet/commands/commanddata.py index be1e4196..8182ed1a 100644 --- a/royalnet/commands/commanddata.py +++ b/royalnet/commands/commanddata.py @@ -52,7 +52,7 @@ class CommandData: text: The text to be sent, possibly formatted in the weird undescribed markup that I'm using.""" raise UnsupportedError(f"'{self.reply.__name__}' is not supported") - async def reply_image(self, image: io.IOBase, caption: str) -> None: + async def reply_image(self, image: io.IOBase, caption: Optional[str] = None) -> None: """Send an image (with optionally a caption) to the channel where the call was made. Parameters: diff --git a/royalnet/serf/discord/discordserf.py b/royalnet/serf/discord/discordserf.py index c33a338e..8cc85a26 100644 --- a/royalnet/serf/discord/discordserf.py +++ b/royalnet/serf/discord/discordserf.py @@ -78,8 +78,8 @@ class DiscordSerf(Serf): async def reply(data, text: str): await data.message.channel.send(escape(text)) - async def reply_image(data, image: io.IOBase, caption: str) -> None: - await data.message.channel.send(file=discord.File(image, 'image')) + async def reply_image(data, image: io.IOBase, caption: Optional[str] = None) -> None: + await data.message.channel.send(caption, file=discord.File(image, 'image')) async def get_author(data, error_if_none=False): user: "discord.Member" = data.message.author diff --git a/royalnet/serf/telegram/telegramserf.py b/royalnet/serf/telegram/telegramserf.py index 1899e1c7..6312d971 100644 --- a/royalnet/serf/telegram/telegramserf.py +++ b/royalnet/serf/telegram/telegramserf.py @@ -117,10 +117,10 @@ class TelegramSerf(Serf): parse_mode="HTML", disable_web_page_preview=True) - async def reply_image(data, image: io.IOBase, caption: str) -> None: + async def reply_image(data, image: io.IOBase, caption: Optional[str] = None) -> None: await self.api_call(data.message.chat.send_photo, photo=image, - caption=escape(caption), + caption=escape(caption) if caption is not None else None, parse_mode="HTML", disable_web_page_preview=True) diff --git a/royalnet/version.py b/royalnet/version.py index a45c0f0b..d8460d48 100644 --- a/royalnet/version.py +++ b/royalnet/version.py @@ -1 +1 @@ -semantic = "5.8.8" +semantic = "5.8.9"