Spaces:
Running

File size: 805 Bytes
cd61bf7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Check webhook configuration"""
from app.core.config import settings
from sqlalchemy import create_engine, text

engine = create_engine(settings.DATABASE_URL)

with engine.connect() as conn:
    result = conn.execute(text('SELECT id, business_name, telegram_bot_token, webhook_url FROM tenants LIMIT 1'))
    row = result.fetchone()
    
    if row:
        print(f"✅ Tenant: {row[1]}")
        print(f"🤖 Bot token: {row[2][:30] if row[2] else 'NONE'}...")
        print(f"🌐 Webhook URL: {row[3] or 'NOT SET'}")
        
        if not row[2]:
            print("\n❌ ПРОБЛЕМА: Telegram bot token не настроен!")
        if not row[3]:
            print("\n❌ ПРОБЛЕМА: Webhook URL не установлен!")
    else:
        print("❌ Tenant не найден!")