bot-activity-handler

Route Microsoft Teams Bot Framework activities with Adaptive Card submit handling.

1|Updated Aug 22, 2025
One-click install
npx skills add https://github.com/interserver/teams-chat-bot --skill bot-activity-handler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bot-activity-handler
Source: https://github.com/interserver/teams-chat-bot/tree/main/.claude/skills/bot-activity-handler
Command: npx skills add https://github.com/interserver/teams-chat-bot --skill bot-activity-handler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of implementing robust Microsoft Teams bot event handling for messages, card submits, reactions, and member/conversation lifecycle events without breaking downstream middleware.

Core Features & Use Cases

  • Bot Framework activity lifecycle hooks: Add targeted handlers for message, member, reaction, delete/update, conversation update, and token response events.
  • Adaptive Card submit routing: Correctly process card submissions delivered as message activities by checking msteams.type inside context.activity.value.
  • Safe middleware chaining: Ensures every registered handler awaits next() to avoid swallowing subsequent middleware, and supports updating cards using injected activityId.

Quick Start

Add the requested handler(s) into server/bot/botActivityHandler.js inside BotActivityHandler’s constructor, ensuring each callback ends with await next() and that any Adaptive Card Action.Submit includes data.msteams.type matching the handler branch.

Frequently Asked Questions about bot-activity-handler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle Adaptive Card submit actions in a Microsoft Teams bot?

To handle Adaptive Card Action.Submit in Microsoft Teams, check context.activity.value?.msteams?.type inside your BotActivityHandler to distinguish card-submit payloads from normal chat text, and inject activityId for subsequent updates.

Why does my Teams bot middleware stop running after an activity handler fires?

Middleware stops running when an activity handler fails to call await next(). Ensure every registered onXxx hook in your BotActivityHandler constructor includes await next() as the final statement to maintain reliable middleware chaining.

How do I update an Adaptive Card after a user submits it in Teams?

Update an Adaptive Card after a submit by injecting the activityId during Action.Submit processing, then calling context.updateActivity using the sent activity id to deterministically refresh or replace the card content.

Can I route conversation update and message lifecycle events in a Teams bot?

Yes, you can route conversation update and message lifecycle events by registering the correct onXxx hook in the BotActivityHandler constructor, enabling deterministic bot logic for membership changes, reactions, and message delete or update events.

Do I need RSC permissions to handle bot activities in Microsoft Teams?

Configuring RSC permissions ensures your BotActivityHandler can securely process channel activities, including Adaptive Card submits and message lifecycle events, within the authorized Microsoft Teams scope.