From 3ffcea70a722419e6e44490843085d713aebff82 Mon Sep 17 00:00:00 2001 From: Dean <36684698+BrettDean@users.noreply.github.com> Date: Sat, 6 Jul 2024 01:44:51 +0800 Subject: [PATCH] Fixed parsing of Telegram entities --- app/modules/telegram/telegram.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/modules/telegram/telegram.py b/app/modules/telegram/telegram.py index c6e15364..9979f42e 100644 --- a/app/modules/telegram/telegram.py +++ b/app/modules/telegram/telegram.py @@ -206,6 +206,7 @@ class Telegram: image_file = Path(settings.TEMP_PATH) / Path(image).name image_file.write_bytes(req.content) photo = InputFile(image_file) + caption = re.sub(r'([_`])', r'\\\1', caption) ret = self._bot.send_photo(chat_id=userid or self._telegram_chat_id, photo=photo, caption=caption,