c800eccc65
https://github.com/user-attachments/assets/5a746414-988b-473c-9401-b8863a3e1c15 https://github.com/user-attachments/assets/0cdebdb1-f7c8-43cb-beef-f279387b6ce9 https://github.com/user-attachments/assets/df31c631-0781-42d8-8e6e-e5a16573ee3b https://github.com/user-attachments/assets/6adaeae4-f3c9-4a5f-b0df-50c1f9a78428 --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: martmull <martmull@hotmail.fr>
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { defineLogicFunction } from 'twenty-sdk/define';
|
||
import { jsonSchemaToInputSchema } from 'twenty-shared/logic-function';
|
||
|
||
import { SLACK_UPDATE_MESSAGE_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
|
||
import { slackUpdateMessageHandler } from 'src/logic-functions/handlers/slack-update-message-handler';
|
||
import { slackUpdateMessageInputSchema } from './schemas/slack-update-message-input.schema';
|
||
|
||
export default defineLogicFunction({
|
||
universalIdentifier: SLACK_UPDATE_MESSAGE_UNIVERSAL_IDENTIFIER,
|
||
name: 'slack-update-message',
|
||
description:
|
||
'Change the text of a message this bot already sent. You need the channel ID and the message’s timestamp from when it was posted.',
|
||
timeoutSeconds: 30,
|
||
toolTriggerSettings: {
|
||
inputSchema: slackUpdateMessageInputSchema,
|
||
},
|
||
workflowActionTriggerSettings: {
|
||
label: 'Update Slack Message',
|
||
icon: 'IconBrandSlack',
|
||
inputSchema: jsonSchemaToInputSchema(slackUpdateMessageInputSchema),
|
||
outputSchema: [
|
||
{
|
||
type: 'object',
|
||
properties: {
|
||
success: { type: 'boolean' },
|
||
message: { type: 'string' },
|
||
error: { type: 'string' },
|
||
slackTs: { type: 'string' },
|
||
channel: { type: 'string' },
|
||
},
|
||
},
|
||
],
|
||
},
|
||
handler: slackUpdateMessageHandler,
|
||
});
|