Forum Discussion
Need help intercepting outgoing messages and accessing chat history in Teams bot (python)
- Mar 21, 2025
Hello GPhbt,
Here are the relevant Microsoft courses and documentation for intercepting outgoing messages and accessing chat history in a Teams bot using Python:
- Microsoft Bot Framework Overview
Azure AI Bot Service documentation - Bot Service | Microsoft Learn
This provides an introduction to building bots with the Microsoft Bot Framework. - Accessing Teams-Specific Features in Bots
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/conversation-basics
This explains how to manage conversations and access chat history in Teams bots. - Middleware for Intercepting Messages
https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-concept-middleware
Middleware can be used to intercept outgoing and incoming messages in a bot. - Python SDK for Bot Framework
microsoft/botbuilder-python: The Microsoft Bot Framework provides what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.
This provides guidance on building bots using the Python SDK. - Graph API for Chat History
https://learn.microsoft.com/en-us/graph/teams-concept-overview
Use Microsoft Graph API to access chat history and other Teams-specific data.
These resources will help you understand how to intercept messages and access chat history in a Teams bot.
- Microsoft Bot Framework Overview
Thank you Sayali-MSFT !
Isn't the code you provided using the old framework? Whereas mine creates the class like this:
bot_app = Application[TurnState](
ApplicationOptions(
bot_app_id=config.APP_ID,
storage=storage,
adapter=TeamsAdapter(config),
ai=AIOptions(planner=planner, enable_feedback_loop=True),
)
)
Since I’m not very experienced in programming, besides the documentation, do you have any other sources where I can learn about it? Maybe a Microsoft course?
Hello GPhbt,
Here are the relevant Microsoft courses and documentation for intercepting outgoing messages and accessing chat history in a Teams bot using Python:
- Microsoft Bot Framework Overview
Azure AI Bot Service documentation - Bot Service | Microsoft Learn
This provides an introduction to building bots with the Microsoft Bot Framework. - Accessing Teams-Specific Features in Bots
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/conversation-basics
This explains how to manage conversations and access chat history in Teams bots. - Middleware for Intercepting Messages
https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-concept-middleware
Middleware can be used to intercept outgoing and incoming messages in a bot. - Python SDK for Bot Framework
microsoft/botbuilder-python: The Microsoft Bot Framework provides what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.
This provides guidance on building bots using the Python SDK. - Graph API for Chat History
https://learn.microsoft.com/en-us/graph/teams-concept-overview
Use Microsoft Graph API to access chat history and other Teams-specific data.
These resources will help you understand how to intercept messages and access chat history in a Teams bot.