feat: add status reactions across messaging channels

This commit is contained in:
xmanrui 2026-08-25 17:12:28 +08:00
parent aa8fd71b93
commit da01e3acee
30 changed files with 1853 additions and 274 deletions

View file

@ -127,6 +127,10 @@ export function normalizeSlackEvent(payload, botUserId, {
? event.files.map((file) => slackFileSource(file, loadFileStream, loadFileInfo)).filter(Boolean)
: [],
addressed: direct || mentioned,
reactionTarget: {
channelId: String(event.channel),
messageTs: String(event.ts),
},
replyTarget: {
channelId: String(event.channel),
threadTs,
@ -284,6 +288,26 @@ export class SlackBotClient {
return { providerMessageIds };
}
async addReaction(target, emoji, { signal } = {}) {
const reactionKey = String(emoji ?? '').trim();
await this.#api.addReaction({
channelId: target.channelId,
messageTs: target.messageTs,
emojiName: reactionKey,
signal: signal ?? this.#signal,
});
return reactionKey;
}
removeReaction(target, reactionKey, { signal } = {}) {
return this.#api.removeReaction({
channelId: target.channelId,
messageTs: target.messageTs,
emojiName: reactionKey,
signal: signal ?? this.#signal,
});
}
openStream(target) {
return createSlackMessageStream({
api: this.#api,