Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created July 9, 2025 03:00
Show Gist options
  • Select an option

  • Save KyMidd/f3e0570fa13a64ae52162cc5b42f4e76 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/f3e0570fa13a64ae52162cc5b42f4e76 to your computer and use it in GitHub Desktop.
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