简体   繁体   English

我可以在不使用 Bot Framework 的情况下创建 Teams 机器人吗?

[英]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.

相关问题 使用 Python 的 Microsoft Teams 机器人 - Microsoft Teams bot using Python 如何使用 Microsoft 机器人框架对我的 python 机器人进行单元测试? - How can I unit test my python bot using Microsoft bot framework? MS团队漫游器-创建新对话 - MS teams bot - create new conversation 使用适用于 Python 的 Bot Framework SDK v4 初始化并向 Microsoft Teams 频道发送消息 - Initial and send a message to a Microsoft Teams channel using Bot Framework SDK v4 for Python 使用 Graph API(不是 Bot Framework)向 Microsoft Teams 发送主动消息 - Sending pro-active messages to Microsoft Teams using Graph API (not Bot Framework) 是否可以在没有密码的情况下运行团队机器人,或者我在创建它时遇到问题? - Is it possible to run a teams bot without password or do I have a problem when creating it? 如何在不使用对话框的情况下为 Microsoft Bot 框架生成 OAUTH 链接? - How to generate OAUTH link for Microsoft Bot framework without using dialogs? 我无法从Microsoft Teams bot向另一个用户发送消息 - I can't send a message to another user from Microsoft Teams bot 如何使用python和bot框架创建一个简单的Skype机器人 - How to create a simple skype bot with python and bot framework 如何在没有用户使用电报机器人上传的情况下发送 gif 或视频 - How can I send gif or video without users uploading using telegram bot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM