我正在将机器人框架与 Python 结合使用,并且已在 Azure 云中部署了机器人服务。我创建了一个通知端点,我基本上想通知所有组,而无需事先在特定组中安装或分配机器人。
在文档中有一个部分解释了您可以使用 Graph 主动安装您的应用程序,但它是代码的一部分,并没有太大帮助。 Link to docs。如何在不将机器人分配给群组的情况下向所有群组发送消息?
async def _send_proactive_message(data):
#i need a proper context and other infos just from http post request
async def notify(req: Request) -> Response:
body = await req.json()
await _send_proactive_message(body)
return Response(status=HTTPStatus.OK, text="Proactive messages have been sent")
APP = web.Application(middlewares=[aiohttp_error_middleware])
APP.router.add_post("/api/notify", notify)