'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?



Solution 1:[1]

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.

Solution 2:[2]

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!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Conrad Lotz
Solution 2 Scott Perham