Files
teams-sample-bot/app.py
2025-11-18 15:24:36 +01:00

21 lines
656 B
Python

from botbuilder.core.integration import aiohttp_error_middleware
from botbuilder.integration.aiohttp import CloudAdapter, ConfigurationBotFrameworkAuthentication
from aiohttp import web
from aiohttp.web import Application
from bot import WebhookBot
from handler import BotHandler
from config import DefaultConfig
CONFIG = DefaultConfig()
ADAPTER = CloudAdapter(ConfigurationBotFrameworkAuthentication(CONFIG))
BOT = WebhookBot(CONFIG)
BOT_HANDLER = BotHandler(ADAPTER, BOT, CONFIG)
APP = Application(middlewares=[aiohttp_error_middleware])
APP.router.add_post("/api/messages", BOT_HANDLER.messages)
web.run_app(APP, host="0.0.0.0", port=CONFIG.PORT)