[英]Can I create a Teams bot without using Bot Framework?
I want to create MS Teams chat-bot without using MS Bot Framework.我想在不使用 MS Bot Framework 的情况下创建 MS Teams 聊天机器人。
However, in the official document, there was only an example of using the MS Bot Framework.但是,在官方文档中,只有一个使用 MS Bot Framework 的示例。
I want to develop this process through message processing through FastAPI and my own AI logic.我想通过 FastAPI 和我自己的 AI 逻辑通过消息处理来开发这个过程。
Is there a guide for proper usage?有正确使用指南吗?
I would recommend using Microsoft Graph Explorer You can create a chat for example.我建议使用Microsoft Graph Explorer例如,您可以创建一个聊天。 The only consideration here is to enable delegated authentication (any user with a Microsoft domain account can authenticate against the app. Some institutions will block this or require application permissions).
此处唯一需要考虑的是启用委派身份验证(任何拥有 Microsoft 域帐户的用户都可以针对应用进行身份验证。一些机构会阻止此操作或要求应用程序权限)。 Ensure that the permission access is strict.
确保权限访问是严格的。 In other words, the app will only access certain types of information from Teams and nothing from Outlook calendar for example.
换句话说,该应用程序只能访问 Teams 中的某些类型的信息,而不会访问 Outlook 日历中的任何信息。
This should be fairly simple in Python using requests for all the API calls.这在 Python 中使用对所有 API 调用的请求应该相当简单。
If you're only looking to send the odd notification to a user you can do this via Graph as Conrad said (there are reasons why this might not be the best solution and taking the bot approach is usually the better option - being able to send a notification from an "app" rather than a user with rich adaptive cards, for example)如果您只是想向用户发送奇怪的通知,您可以通过 Graph 执行此操作,正如 Conrad 所说(这可能不是最佳解决方案的原因,而采用机器人方法通常是更好的选择 - 能够发送例如,来自“应用程序”而不是具有丰富自适应卡片的用户的通知)
The main thing to remember here is that a "bot" is just an api endpoint and the "bot framework sdk" largely exists to simplify the process of parsing and processing the messages that are sent on that endpoint (and some additional complexities around auth with the Azure bot service, etc).这里要记住的主要事情是,“bot”只是一个 api 端点,而“bot 框架 sdk”的存在主要是为了简化解析和处理在该端点上发送的消息的过程(以及一些关于 auth 的额外复杂性) Azure 机器人服务等)。 The interaction between Teams and your bot is also not request/response it's actually request/request and the SDK does a reasonable job of abstracting this so you don't have to worry about it.
Teams 和你的机器人之间的交互也不是请求/响应,它实际上是请求/请求,SDK 做了合理的抽象工作,所以你不必担心它。
Having said that, as long as you have an api endpoint that will accept the messages being sent from Teams (and proxied through the bot service) you don't have to use the sdk, plus it's all open source so you can inspect the framework to see what it's doing... I'd highly recommend using it though as it really does make your life a lot easier and some of those message structures aren't very well documented... the bottom line is that it's not trivial, but it is possible!话虽如此,只要您有一个 api 端点可以接受从 Teams 发送的消息(并通过 bot 服务代理),您就不必使用 sdk,而且它都是开源的,因此您可以检查框架看看它在做什么......我强烈建议使用它,因为它确实让你的生活更轻松,而且其中一些消息结构没有很好的记录......最重要的是它不是微不足道的,但这是可能的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.