【发布时间】:2020-02-26 08:21:20
【问题描述】:
Microsoft 使用以下方式发送主动通知(https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0&tabs=python)
async def notify(req: Request) -> Response:
await _send_proactive_message()
return Response(status=201, text="Proactive messages have been sent")
APP = web.Application(middlewares=[aiohttp_error_middleware])
APP.router.add_post("/api/messages", messages)
APP.router.add_get("/api/notify", notify)
但我想要的是在特定时间发送通知。我认为用 asyncio 创建任务可能是解决这个问题的方法。这是最好的方法还是我可以使用机器人框架的一些库来解决这个问题?
【问题讨论】:
标签: python asynchronous botframework python-asyncio aiohttp