Created
July 24, 2025 15:34
-
-
Save KyMidd/78a6e3b3cb15fbd64a6fbd4612cc90fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_teams_conversation_history(user_graph_auth_token, event_body): | |
| #... | |
| # Look at type of conversation and build URL to fetch messages | |
| if conversation_type == "channel": | |
| #... | |
| # Read conversation ID, find the parent message ID of the conversaton "Post"/thread | |
| try: | |
| full_convo_id = event_body.get("conversation", {}).get("id", "") | |
| parent_message_id = None | |
| if ";messageid=" in full_convo_id: | |
| parent_message_id = full_convo_id.split(";messageid=")[-1] | |
| else: | |
| raise Exception("❓ Could not extract root message ID from conversation ID") | |
| except Exception as error: | |
| print(f"🚫 Error extracting root message ID: {error}") | |
| raise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment