From d8155bc8ebbc318e2309e97a1c472f4c011519d5 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Fri, 7 Mar 2025 00:42:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Telegram=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=99=A8=E4=BD=BF=E7=94=A8=E4=BB=A3=E7=90=86=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E5=9B=BE=E7=89=87?= =?UTF-8?q?=20#723?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/platform/sources/telegram/tg_adapter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/astrbot/core/platform/sources/telegram/tg_adapter.py b/astrbot/core/platform/sources/telegram/tg_adapter.py index 528141a09..0eed9036b 100644 --- a/astrbot/core/platform/sources/telegram/tg_adapter.py +++ b/astrbot/core/platform/sources/telegram/tg_adapter.py @@ -50,10 +50,14 @@ class TelegramPlatformAdapter(Platform): ) if not base_url: base_url = "https://api.telegram.org/bot" + + self.base_url = base_url + self.application = ( ApplicationBuilder() .token(self.config["telegram_token"]) .base_url(base_url) + .base_file_url(base_url) .build() ) message_handler = TelegramMessageHandler( @@ -62,6 +66,7 @@ class TelegramPlatformAdapter(Platform): ) self.application.add_handler(message_handler) self.client = self.application.bot + logger.debug(f"Telegram base url: {self.client.base_url}") @override async def send_by_session(