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)