Sample: opt targeted-messages example into slash commands#430
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the examples/targeted-messages sample to demonstrate opting targeted-messages into Teams slash commands via the devPreview manifest schema, and adds an inbound check to show when a message arrived as “targeted”.
Changes:
- Add a devPreview Teams manifest that opts the bot into slash-triggered targeted messages and lists slash commands.
- Add
test inboundhandler to report whether the inbound activity was targeted. - Update docs and
.gitignoreto track the sample’s manifest and describe the new configuration/commands.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| examples/targeted-messages/src/main.py | Adds test inbound command handler and updates help text. |
| examples/targeted-messages/appPackage/manifest.json | New devPreview manifest enabling slash-triggered targeted messages and listing commands. |
| examples/targeted-messages/README.md | Updates commands table and documents devPreview manifest opt-in fields. |
| .gitignore | Un-ignores the targeted-messages manifest so it can be committed. |
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"] Ships the manifest at appPackage/manifest.json (with a narrowly-scoped .gitignore exception for this example) so the slash-commands opt-in is discoverable. Adds a `test inbound` handler that demonstrates `activity.recipient.is_targeted` detection (the signal slash commands arrive with). README documents the new fields and handler.
activity.recipient is typed Account (non-Optional) on MessageActivity, so the 'is not None' branch was unreachable and triggered reportUnnecessaryComparison.
29ee5d4 to
e7a3e09
Compare
MehakBindra
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the
targeted-messagesexample to demonstrate the slash-commands opt-in per the docs spec (microsoft/teams-sdk#2843, MicrosoftDocs/msteams-docs#14182).Changes
examples/targeted-messages/appPackage/manifest.json(new) — shipped atmanifestVersion: "devPreview"because the slash-commands opt-in fields are only defined in the devPreview schema today:bots[].supportsTargetedMessages: trueopts the bot into receiving slash-command-style targeted messages.bots[].commandLists[].triggers: ["slash"]declarestest send/test update/test delete/test public/test inboundas slash commands surfaced in the Teams/picker (scoped toteamandgroupChat)..gitignore— narrowly-scoped exception so this one example's manifest can be tracked. The generalexamples/**/appPackage/exclusion remains in place for other examples.examples/targeted-messages/src/main.py— newtest inboundhandler that readsactivity.recipient.is_targetedand 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
python3 -m py_compile examples/targeted-messages/src/main.pycleanpyright examples/targeted-messages/src/main.pycleanexamples/targeted-messages/appPackage/manifest.jsonvalidates against the Teams devPreview schema (placeholder${{...}}tokens excepted)test inboundhandler verified live in Teams: broadcast branch fires when the inbound is not targeted (the targeted branch will fire once slash commands start delivering withrecipient.is_targeted = True)🤖 Generated with Claude Code