From 3a89856b54e33ee646d6dfdd746961dc188c9cec Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 12 Oct 2024 22:44:21 +0300 Subject: [PATCH] bot name in telegram messages --- crypto/sol/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/sol/app.py b/crypto/sol/app.py index 6ec719f..2c87c19 100644 --- a/crypto/sol/app.py +++ b/crypto/sol/app.py @@ -54,6 +54,7 @@ TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") SOLANA_WS_URL = os.getenv("SOLANA_WS_URL") SOLANA_HTTP_URL = os.getenv("SOLANA_HTTP_URL") DISPLAY_CURRENCY = os.getenv('DISPLAY_CURRENCY', 'USD') +BOT_NAME = os.getenv("BOT_NAME") logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) @@ -130,7 +131,7 @@ except Exception as e: # # # # # # # # # # TELEGRAM # # # # # # # # # # async def send_telegram_message(message): try: - await bot.send_message(chat_id=DEVELOPER_CHAT_ID, text=message, parse_mode=ParseMode.HTML) + await bot.send_message(chat_id=DEVELOPER_CHAT_ID, text=f"[{BOT_NAME}] {message}", parse_mode=ParseMode.HTML) logging.info(f"Telegram message sent: {message}") # logging.info(f"Telegram message dummy sent: {message}") except Exception as e: