简体   繁体   中英

Can I create a Teams bot without using Bot Framework?

I want to create MS Teams chat-bot without using MS Bot Framework.

However, in the official document, there was only an example of using the MS Bot Framework.

I want to develop this process through message processing through FastAPI and my own AI logic.

Is there a guide for proper usage?

I would recommend using Microsoft Graph Explorer You can create a chat for example. 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). 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.

This should be fairly simple in Python using requests for all the API calls.

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)

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). 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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM