import asyncio
from aiogram import Bot
from app.config import BOT_TOKEN, WEBHOOK_URL, WEBHOOK_SECRET
async def main():
    if not BOT_TOKEN or not WEBHOOK_URL or not WEBHOOK_SECRET:
        raise SystemExit("BOT_TOKEN, WEBHOOK_URL and WEBHOOK_SECRET are required")
    bot = Bot(BOT_TOKEN)
    try:
        await bot.set_webhook(WEBHOOK_URL, secret_token=WEBHOOK_SECRET, drop_pending_updates=False)
        print("Webhook configured:", WEBHOOK_URL)
    finally:
        await bot.session.close()
if __name__ == "__main__":
    asyncio.run(main())
