Files
botpress--botpress/integrations/slack/src/actions/get-channels-info.ts
T
2026-07-13 13:34:48 +08:00

19 lines
614 B
TypeScript

import { wrapActionAndInjectSlackClient } from 'src/actions/action-wrapper'
export const getChannelsInfo = wrapActionAndInjectSlackClient(
{ actionName: 'getChannelsInfo', errorMessage: 'Failed to get channels info' },
async ({ slackClient }, { includeArchived, includePrivate, includeDm, cursor }) => {
const { channels, nextCursor } = await slackClient.getChannelsInfo({
includeArchived: includeArchived ?? false,
includePrivate: includePrivate ?? false,
includeDm: includeDm ?? false,
cursor,
})
return {
channels,
nextCursor: nextCursor ?? '',
}
}
)