Slack: support Block Kit blocks in editMessage

This commit is contained in:
Colin
2026-02-16 12:08:58 -05:00
committed by Peter Steinberger
parent c9684a2678
commit 08bc1dce6a
3 changed files with 62 additions and 7 deletions

View File

@@ -167,13 +167,14 @@ export async function editSlackMessage(
channelId: string,
messageId: string,
content: string,
opts: SlackActionClientOpts = {},
opts: SlackActionClientOpts & { blocks?: (Block | KnownBlock)[] } = {},
) {
const client = await getClient(opts);
await client.chat.update({
channel: channelId,
ts: messageId,
text: content,
text: content || " ",
...(opts.blocks?.length ? { blocks: opts.blocks } : {}),
});
}