Slack: support blocks in plugin edit action

This commit is contained in:
Colin
2026-02-16 12:20:09 -05:00
committed by Peter Steinberger
parent 3912a2264b
commit 378e18b75b
2 changed files with 78 additions and 2 deletions

View File

@@ -130,13 +130,18 @@ export async function handleSlackMessageAction(params: {
const messageId = readStringParam(actionParams, "messageId", {
required: true,
});
const content = readStringParam(actionParams, "message", { required: true });
const content = readStringParam(actionParams, "message", { allowEmpty: true });
const blocks = readSlackBlocksParam(actionParams);
if (!content && !blocks) {
throw new Error("Slack edit requires message or blocks.");
}
return await invoke(
{
action: "editMessage",
channelId: resolveChannelId(),
messageId,
content,
content: content ?? "",
blocks,
accountId,
},
cfg,