# Source - https://stackoverflow.com/q
# Posted by TheFlappy
# Retrieved 2025-11-11, License - CC BY-SA 4.0
async def on_startup(bot: Bot) -> None:
await bot.set_webhook(f"{BASE_WEBHOOK_URL}{WEBHOOK_PATH}")
def main():
bot = Bot(TOKEN, parse_mode='HTML')
dp = Dispatcher()
dp.startup.register(on_startup)
app = web.Application()
webhook_requests_handler = SimpleRequestHandler(
dispatcher=dp,
bot=bot
)
webhook_requests_handler.register(app, path=WEBHOOK_PATH)
setup_application(app, dp, bot=bot)
web.run_app(app, host=WEB_SERVER_HOST, port=WEB_SERVER_PORT)
if _name_ == "_main_":
main()