Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create actions to expose integration functionality to bots
export default new IntegrationDefinition({ actions: { sendMessage: { title: 'Send Message', description: 'Send a message to external platform', input: { schema: z.object({ channel: z.string(), text: z.string(), }), }, output: { schema: z.object({ messageId: z.string(), success: z.boolean(), }), }, }, }, })
import type { ActionHandlers } from '.botpress/implementation' export const sendMessage: ActionHandlers['sendMessage'] = async ({ input, ctx, logger, }) => { const config = JSON.parse(ctx.configuration.payload) const response = await fetch(`${config.apiUrl}/messages`, { method: 'POST', headers: { 'Authorization': `Bearer ${config.apiKey}` }, body: JSON.stringify(input), }) const data = await response.json() return { messageId: data.id, success: true, } }