瀏覽代碼

Update Telegram bot to use Config.TELEGRAM_CHAT_ID for message sending - Refactor the send_message method to replace the use of authorized_chat_id with the configuration constant, ensuring consistent chat ID usage across the bot's messaging functionality.

Carles Sentis 6 天之前
父節點
當前提交
25635c9be6
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/telegram_bot.py

+ 2 - 2
src/telegram_bot.py

@@ -59,10 +59,10 @@ class TelegramTradingBot:
     
     async def send_message(self, text: str, parse_mode: str = 'HTML') -> None:
         """Send a message to the authorized chat."""
-        if self.application and self.authorized_chat_id:
+        if self.application and Config.TELEGRAM_CHAT_ID:
             try:
                 await self.application.bot.send_message(
-                    chat_id=self.authorized_chat_id,
+                    chat_id=Config.TELEGRAM_CHAT_ID,
                     text=text,
                     parse_mode=parse_mode
                 )