Support custom Telegram API URL

This commit is contained in:
xtaodada 2023-09-17 21:52:47 +08:00
parent 1287afc9c5
commit a03ba48c06
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,8 @@ class Application(Singleton):
.get_updates_pool_timeout(application_config.update_pool_timeout)
.defaults(Defaults(tzinfo=pytz.timezone("Asia/Shanghai")))
.token(application_config.bot_token)
.base_url(application_config.bot_base_url)
.base_file_url(application_config.bot_base_file_url)
.request(
HTTPXRequest(
connection_pool_size=application_config.connection_pool_size,

View File

@ -118,6 +118,10 @@ class ApplicationConfig(Settings):
bot_token: str = ""
"""BOT的token"""
bot_base_url: str = "https://api.telegram.org/bot"
"""Telegram API URL"""
bot_base_file_url: str = "https://api.telegram.org/file/bot"
"""Telegram API File URL"""
owner: Optional[int] = None