Skip to content

Sample: opt targeted-messages example into slash commands#583

Merged
corinagum merged 1 commit into
mainfrom
cg/slash-commands-sample
May 20, 2026
Merged

Sample: opt targeted-messages example into slash commands#583
corinagum merged 1 commit into
mainfrom
cg/slash-commands-sample

Conversation

@corinagum
Copy link
Copy Markdown
Collaborator

@corinagum corinagum commented May 19, 2026

Updates the targeted-messages example manifest to opt into slash commands per the docs spec (microsoft/teams-sdk#2843, MicrosoftDocs/msteams-docs#14182), and adds a handler that demonstrates how slash commands surface to the bot.

Changes

  • examples/targeted-messages/appPackage/manifest.json:
    • Bump $schema and manifestVersion to devPreview (the slash-commands opt-in fields are only defined in the devPreview schema today).
    • Add bots[].supportsTargetedMessages: true to opt the bot into receiving slash-command-style targeted messages.
    • Add bots[].commandLists[].triggers: ["slash"] declaring test send / test update / test delete / test public / test inbound as slash commands surfaced in the Teams / picker (scoped to team and groupChat).
  • examples/targeted-messages/src/index.ts — new test inbound handler that reads activity.recipient?.isTargeted and reports whether the inbound message was delivered as a targeted message (the signal slash commands arrive with).
  • examples/targeted-messages/README.md — refreshed commands table, new "Manifest configuration" section documenting the new fields.

Test plan

  • npx turbo build --filter=@examples/targeted-messages clean
  • examples/targeted-messages/appPackage/manifest.json validates against the Teams devPreview schema (placeholder ${{...}} tokens excepted)
  • Sample bot's test inbound handler verified live in Teams: broadcast branch fires when the inbound is not targeted (the targeted branch will fire once slash commands start delivering with recipient.isTargeted = true)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 19, 2026 19:26
Adds the devPreview manifest fields per the slash-commands docs spec
(microsoft/teams-sdk#2843, MicrosoftDocs/msteams-docs#14182):

- bots[].supportsTargetedMessages: true
- bots[].commandLists[].triggers: ["slash"]

Switches \$schema/manifestVersion to devPreview since v1.20 doesn't
define these fields yet. Adds a `test inbound` handler that demonstrates
`activity.recipient.isTargeted` detection (the signal slash commands
arrive with). README documents the new fields and handler.
@corinagum corinagum force-pushed the cg/slash-commands-sample branch from 97f81e1 to 2cedb9a Compare May 20, 2026 21:36
@corinagum corinagum merged commit 3d275ac into main May 20, 2026
8 checks passed
@corinagum corinagum deleted the cg/slash-commands-sample branch May 20, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants