Reactions and Mentions
Reactions
Reactions use the Microsoft Graph v1.0 setReaction and unsetReaction actions.
teams message react --team "$TEAM_ID" --channel "$CHANNEL_ID" --message-id "$MESSAGE_ID" --reaction like
teams message unreact --team "$TEAM_ID" --channel "$CHANNEL_ID" --message-id "$MESSAGE_ID" --reaction like
Chat messages are addressed with --chat instead of the --team/--channel pair:
teams message react --chat "$CHAT_ID" --message-id "$MESSAGE_ID" --reaction 🎉
Graph requires a unicode emoji on writes and rejects the classic names by name, so the CLI
translates them for you: like, heart, laugh, surprised, sad, angry, plus thumbsup,
thumbsdown, eyes, tada, rocket and fire. Any emoji character passes through unchanged.
A user has one reaction per message — reacting again replaces the previous one. Removing a reaction that is not there is a no-op rather than an error.
Mentions
message send --mention and message reply --mention tag a person with a real Teams @mention, in
chats, channels and channel replies. The flag is repeatable and takes an Entra object ID or a user
principal name.
teams message send --chat "$CHAT_ID" \
--body "can you take a look?" \
--mention alice@contoso.com \
--output json
teams message send --team "$TEAM_ID" --channel "$CHANNEL_ID" \
--body "deploy is green" \
--mention alice@contoso.com \
--mention 32cbca05-dc05-454f-b0f3-072f331d4c97 \
--output json
teams message reply --team "$TEAM_ID" --channel "$CHANNEL_ID" --message-id "$ROOT_MESSAGE_ID" \
--body "I have picked this up." \
--mention alice@contoso.com \
--output json
Graph only keeps a mention when the message body's <at id="N"> elements are synchronized with a
top-level mentions array, so the CLI builds both halves and keeps their IDs in step. Each value is
resolved through Graph first and must yield a canonical object ID and a display name.
Things worth knowing:
- Mentions are prefixed to the body in flag order.
- Two values that resolve to the same person collapse to one mention.
- A mention on its own is a complete message —
--bodyis optional when you pass--mention. - A plain-text body is promoted to HTML safely, with the text escaped.
- Raw
<at>markup in an HTML body without--mentionis rejected before anything is sent, because Graph would strip a mention whose IDs do not line up.
Resolving a name needs User.ReadBasic.All, which is in the default scope set. message list and
message get return any mentions Graph reports, so a read-back shows what was tagged. Each mention's
mentioned object holds whichever identity Graph returned: user for a person; conversation for
@Everyone, an @channel or an @team, with conversationIdentityType set to chat, channel or
team; tag for a team tag; and application for a bot or app. Before v0.8.0 only user was
kept, and the other kinds read back as an empty {}.
A message posted by a bot, workflow or connector carries its sender in from.application, and the
human table's From column shows the application's name.
--mention is available on message send and message reply. Adding it to message update is
follow-up work.