Skip to content

Commit d4fb25a

Browse files
committed
review: add comment to getActionNameAndType
1 parent 9a2bd6b commit d4fb25a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

integrations/slack/src/utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ export function stripBotName(text: string, botName: string) {
109109
return text.split(new RegExp(`^.*<@${botName}> `)).join('');
110110
}
111111

112+
/**
113+
* Extracts the action name and type from a Slack interaction payload.
114+
*
115+
* This function supports both shortcut and block action payloads:
116+
* - Shortcuts can be triggered from menus such as the "More actions" button on messages.
117+
* - Block actions come from interactive Block Kit components.
118+
*
119+
* Because all these events are handled as "actions" in the integration, this helper
120+
* centralizes how we derive the action name and type from the event payload.
121+
*/
112122
export function getActionNameAndType(payload: any) {
113123
let actionId: string | undefined;
114124

0 commit comments

Comments
 (0)