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
-
Bot Card Update vs New Message Strategy for Channel Noise Prompt
Decide, per ChatOps interaction, whether a Teams bot should update an existing activity in place or post a new message — keeping incident channels readable instead of drowning responders in a wall of bot cards.
-
Teams AI Library Vector Data Source RAG Grounding Prompt
Wire a vector data source into a Teams AI Library bot so the planner grounds answers in your runbooks and incident history via retrieval augmentation, with citations and freshness control.
-
Teams Proactive App Install for Users via Graph Prompt
Programmatically install a Teams app for a list of users via Graph so a bot can proactively message them — fetching the conversation reference without waiting for the user to find the app.
-
Teams Bot CLU Intent Dispatch and Command Routing Prompt
Design a natural-language command router for a Teams bot that uses Conversational Language Understanding to classify intents and dispatch to ChatOps handlers with a deterministic fallback
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
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.