/** *MapaUnicodeemojiorTeamsreactionnametotheTeamsAPIreactiontype. *Fallsbacktotheoriginalvalueifnotrecognized.
*/ function resolveTeamsReactionType(emoji: string): string { const trimmed = emoji.trim(); // If it's already a Teams native type, use it directly. if (/^(like|heart|laugh|surprised|sad|angry)$/.test(trimmed)) { return trimmed;
} return UNICODE_TO_TEAMS_REACTION[trimmed] ?? trimmed;
}
export type ReactMessageMSTeamsParams = { /** Full config (for credentials) */
cfg: OpenClawConfig; /** Conversation ID or user ID to address */
to: string; /** Activity/message ID to react to */
activityId: string; /** Emoji or Teams reaction type (like, heart, laugh, surprised, sad, angry) */
emoji: string;
};
export type ReactMessageMSTeamsResult = {
ok: true;
};
// Strip conversation: prefix if present — Graph API uses the bare chat ID. const rawTo = to.trim().replace(/^conversation:/, ""); const conversationId = normalizeMSTeamsConversationId(rawTo); if (!isGraphCompatibleConversationId(conversationId)) {
log.warn?.( "MS Teams reactions via Graph API require a 19:xxx@thread conversation ID; " + "Bot Framework personal DM IDs are not supported",
{ conversationId },
); thrownew Error(
`MS Teams reaction requires a Graph-compatible conversation ID (got: ${conversationId}). ` + "Personal DM conversations must be addressed via their 19:xxx@thread.* chat ID.",
);
}
export type RemoveReactionMSTeamsParams = { /** Full config (for credentials) */
cfg: OpenClawConfig; /** Conversation ID or user ID to address */
to: string; /** Activity/message ID to remove reaction from */
activityId: string; /** Emoji or Teams reaction type to remove */
emoji: string;
};
// Strip conversation: prefix if present — Graph API uses the bare chat ID. const rawTo = to.trim().replace(/^conversation:/, ""); const conversationId = normalizeMSTeamsConversationId(rawTo); if (!isGraphCompatibleConversationId(conversationId)) {
log.warn?.("MS Teams reactions via Graph API require a 19:xxx@thread conversation ID", {
conversationId,
}); thrownew Error(
`MS Teams reaction requires a Graph-compatible conversation ID (got: ${conversationId}).`,
);
}
// --------------------------------------------------------------------------- // List reactions (read-only, works with Application auth) // ---------------------------------------------------------------------------
type GraphMessageWithReactions = {
reactions?: GraphReaction[];
};
export type ListReactionsMSTeamsParams = { /** Full config (for credentials) */
cfg: OpenClawConfig; /** Conversation ID (19:xxx@thread.*) or teamId/channelId */
to: string; /** Message ID to list reactions for */
messageId: string;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.