Skip to main content
Glama

mcp-google-sheets

send-message-action.ts1.85 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { profilePicture, slackChannel, username, blocks, threadTs, singleSelectChannelInfo, } from '../common/props'; import { processMessageTimestamp, slackSendMessage } from '../common/utils'; import { slackAuth } from '../../'; import { Block,KnownBlock } from '@slack/web-api'; export const slackSendMessageAction = createAction({ auth: slackAuth, name: 'send_channel_message', displayName: 'Send Message To A Channel', description: 'Send message to a channel', props: { info: singleSelectChannelInfo, channel: slackChannel(true), text: Property.LongText({ displayName: 'Message', description: 'The text of your message', required: true, }), username, profilePicture, file: Property.File({ displayName: 'Attachment', required: false, }), threadTs, replyBroadcast: Property.Checkbox({ displayName: 'Broadcast reply to channel', description: 'When replying to a thread, also make the message visible to everyone in the channel (only applicable when Thread Timestamp is provided)', required: false, defaultValue: false, }), blocks, }, async run(context) { const token = context.auth.access_token; const { text, channel, username, profilePicture, threadTs, file, blocks, replyBroadcast } = context.propsValue; const blockList = blocks ?[{ type: 'section', text: { type: 'mrkdwn', text } }, ...(blocks as unknown as (KnownBlock | Block)[])] :undefined return slackSendMessage({ token, text, username, profilePicture, conversationId: channel, threadTs: threadTs ? processMessageTimestamp(threadTs) : undefined, file, blocks: blockList, replyBroadcast, }); }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server