Skip to content

Commit 762c6ac

Browse files
committed
feat: remove redundant activateForKeywords
1 parent af7fdfc commit 762c6ac

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

apps/api/src/workflow-triggers/controllers/chatbot.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ export class ChatbotController {
151151
return
152152
}
153153

154-
// filter keywords on activateForKeywords
155-
if (workflowTrigger.inputs?.activateForKeywords) {
154+
// filter by allowed keywords
155+
if (workflowTrigger.inputs?.keywords?.trim()) {
156156
const keywords = workflowTrigger.inputs.keywords.split(',').map((keyword: string) => keyword.trim().toLowerCase())
157157
if (!keywords.some((keyword: string) => message.content.toLowerCase().includes(keyword))) {
158158
return

libs/definitions/src/integration-definitions/chatbot/triggers/new-chatbot-message.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ import { JSONSchema7 } from 'json-schema'
66
export class NewChatbotMessageTrigger extends OperationTrigger {
77
idKey = 'items[].id'
88
key = 'newChatbotMessage'
9-
name = 'New Chatbot Message'
9+
name = 'New Message'
1010
description = 'Triggers when you receive a new chatbot message.'
1111
version = '1.0.0'
1212
triggerInstant = true
1313

1414
inputs: JSONSchema7 = {
1515
required: [],
1616
properties: {
17-
activateForKeywords: {
18-
type: 'boolean',
19-
title: 'Only activate for specific keywords',
20-
description: 'Whether this chatbot should be run for any keyword or only specific keywords.',
21-
},
2217
activateOncePerContact: {
2318
type: 'boolean',
2419
title: 'Only activate once per contact',
@@ -27,12 +22,13 @@ export class NewChatbotMessageTrigger extends OperationTrigger {
2722
keywords: {
2823
type: 'string',
2924
title: 'Keywords',
30-
description: 'Enter one or more keywords separated by commas. Keywords are case insensitive.',
25+
description:
26+
'Only activate this chatbot when the user sends one of these keywords. Enter one or more keywords separated by commas. Leave blank to activate on any message.',
3127
},
3228
tags: {
3329
type: 'string',
3430
title: 'Tags',
35-
description: 'Enter one or more tags separated by commas.',
31+
description: 'Tag contacts who message this chatbot. Enter one or more tags separated by commas.',
3632
},
3733
},
3834
}
@@ -62,7 +58,7 @@ export class NewChatbotMessageTrigger extends OperationTrigger {
6258
},
6359
}
6460

65-
async run({ inputs, credentials, workflowOperation }: OperationRunOptions): Promise<RunResponse | null> {
61+
async run({}: OperationRunOptions): Promise<RunResponse | null> {
6662
return {
6763
outputs: {
6864
items: [],

0 commit comments

Comments
 (0)