-
-
Save KyMidd/f3e0570fa13a64ae52162cc5b42f4e76 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 handle_teams_event(body, event): | |
| # ... | |
| if event_type == 'message': | |
| # ... | |
| # Find the service URL and conversation ID from the event body | |
| service_url = body["serviceUrl"] | |
| conversation_id = body["conversation"]["id"] | |
| response_url = f"{service_url}/v3/conversations/{conversation_id}/activities" | |
| # Send the card to the user | |
| if response_url: | |
| headers = { | |
| "Authorization": f"Bearer {bot_bearer_token}", | |
| "Content-Type": "application/json" | |
| } | |
| response = requests.post(response_url, headers=headers, json=card) | |
| # Read VERA_DEBUG from environment variable | |
| if os.environ.get("VERA_DEBUG") == "True": | |
| print("🟢 Response from sending auth card:", response.text) | |
| response.raise_for_status() | |
| print("🟢 Auth card sent successfully") | |
| # All done, return | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment