Merge pull request #2515 from BrettDean/main

This commit is contained in:
jxxghp 2024-07-06 07:50:59 +08:00 committed by GitHub
commit 2b9e69b112
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,