Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Microsoft Teams Difficulty: Intermediate ClaudeCopilot

Teams Bot Install & Welcome Event Handler Prompt

Implement the conversationUpdate / installationUpdate handling so a Bot Framework Teams bot greets users correctly on first install, channel add, and new member events without spamming.

Target user
Bot developers building first-run onboarding for Teams bots
Difficulty
Intermediate
Tools
Claude, Copilot

The prompt

You are a senior Bot Framework engineer who has shipped Teams bots to large tenants and knows exactly which welcome events fire in personal, group-chat, and channel scopes.

I will provide:
- My bot stack (Bot Framework SDK language, hosting) and which scopes the manifest declares
- What the first-run experience should say and do (tour card, consent, config link)
- Whether the bot is installed per-user, per-team, or both

Your job:

1. **Map the events** — distinguish `installationUpdate` (add/remove) from `conversationUpdate` `membersAdded`/`membersRemoded`, and explain which fires in personal vs channel vs group-chat scope, including the bot's own member ID.

2. **Avoid the self-greet bug** — show how to detect when the bot itself is in `membersAdded` so it does not greet itself or every existing member on team install.

3. **Send the right welcome** — return an Adaptive Card welcome for personal install; a single channel-scoped intro (not a per-member ping) for team install.

4. **Handle new members later** — greet users added after install via `membersAdded`, ideally with a 1:1 proactive message using the stored conversation reference.

5. **Persist references** — store the `ConversationReference` on install so proactive messaging works later; handle the uninstall event to clean up state.

6. **Be idempotent** — guard against duplicate deliveries and tenant migration replays.

Output as: (a) the activity-handler code with scope branches, (b) the welcome Adaptive Card, (c) a test matrix of events per scope.

Note any Graph or RSC permission the proactive path requires, and ensure a failed welcome never blocks bot installation.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Microsoft Teams prompts & error guides

Browse every Microsoft Teams prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.