(20250128) Telegram Auth is operational now.

This commit is contained in:
2025-01-28 11:02:15 +05:30
parent 3b8d248d82
commit 48753dd617
5 changed files with 282 additions and 16 deletions
+31
View File
@@ -248,6 +248,37 @@ async def callback_test(
"senderId": inbound_data.auth.senderId
},
display_name = inbound_data.auth.senderId,
display_picture = None,
session_token = inbound_headers["X-Session-Token"]
)
# ┏┓ ┏┳┓ ┓
# ┣ ┏┓┏┓ ┃ ┏┓┃┏┓┏┓┏┓┏┓┏┳┓
# ┻ ┗┛┛ ┻ ┗ ┗┗ ┗┫┛ ┗┻┛┗┗
# ┛
if inbound_data.chatClient == "telegram":
success = await current_app.telegram_controller.set_token_direct(
sql_conn = current_app.sql_writer,
mongo_data_conn = current_app.data_mongo,
auth_token = CoreAuthTokenModel(
serviceType = "chat",
client = inbound_data.chatClient,
authType = "auth",
auth = inbound_data.auth.model_dump(),
user = kwargs.get("session_info"),
clientUserId = {
"botToken": inbound_data.auth.botToken
},
status = "active",
syncFreq = 60
),
token_notes = {
"botId": inbound_data.auth.botId,
"botName": inbound_data.auth.botName
},
display_name = inbound_data.auth.botName,
display_picture = None,
session_token = inbound_headers["X-Session-Token"]
)
+7
View File
@@ -88,6 +88,7 @@ from controllers_v2.message.mail.gmail import GmailController
# ---
from controllers_v2.message.chat.all_chat import AllChatController
from controllers_v2.message.chat.whatsapp_nimbus import WhatsAppNimbusController
from controllers_v2.message.chat.telegram import TelegramController
# ---
from controllers_v2.finstitutions.trading.all_trading import AllTradingController
from controllers_v2.finstitutions.trading.zerodha_kite import ZerodhaKiteTradingController
@@ -506,6 +507,12 @@ async def app_startup(**kwargs):
alert_url = current_app.script_data["alerts"]["url"],
debug = enable_debugging
)
current_app.telegram_controller = TelegramController(
cache = current_app.module_cache,
http_client = current_app.http_client,
alert_url = current_app.script_data["alerts"]["url"],
debug = enable_debugging
)
current_app.printer("Message/Chat (C) ready.")
# Finstitutions / Trading Controllers: