@bavard/agent-config
Advanced tools
Comparing version 0.1.12 to 0.1.13
@@ -64,3 +64,3 @@ import { AgentConfig } from "../agent-config"; | ||
export interface ISlackService { | ||
sendSlackMessage(message: string, slackUrl: string): void; | ||
sendSlackMessage(message: string, slackUrl: string, conversationUrl?: string): void; | ||
} | ||
@@ -67,0 +67,0 @@ export interface ISMSService { |
@@ -213,3 +213,3 @@ "use strict"; | ||
else if (agentAction.type === enums_1.EAgentActionTypes.SLACK_ACTION) { | ||
yield this.handleSlackAction(agentAction); | ||
yield this.handleSlackAction(agentAction, conversation.messageCenterUrl); | ||
} | ||
@@ -433,8 +433,4 @@ // Do notifications. | ||
messageCenterUrl) { | ||
let msg = `The chatbot action '${agentAction.name || agentAction.type}' was triggered.`; | ||
if (messageCenterUrl) { | ||
msg += "\n"; | ||
msg += `View the conversation [here](${messageCenterUrl})`; | ||
} | ||
this.slackService.sendSlackMessage(msg, config.notificationSettings.slackUrl); | ||
const msg = `The chatbot action '${agentAction.name || agentAction.type}' was triggered.`; | ||
this.slackService.sendSlackMessage(msg, config.notificationSettings.slackUrl, messageCenterUrl); | ||
} | ||
@@ -606,3 +602,3 @@ } | ||
*/ | ||
handleSlackAction(agentAction) { | ||
handleSlackAction(agentAction, conversationUrl) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -612,3 +608,3 @@ if (!this.slackService) { | ||
} | ||
this.slackService.sendSlackMessage(agentAction.message, agentAction.slackUrl); | ||
this.slackService.sendSlackMessage(agentAction.message, agentAction.slackUrl, conversationUrl); | ||
}); | ||
@@ -615,0 +611,0 @@ } |
{ | ||
"name": "@bavard/agent-config", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"description": "Shared code and single source of truth for Bavard data models.", | ||
@@ -33,3 +33,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@bavard/eslint-config-typescript": "^0.1.8", | ||
"@bavard/eslint-config-typescript": "^0.1.13", | ||
"@types/chai": "^4.2.21", | ||
@@ -36,0 +36,0 @@ "@types/lodash": "^4.14.171", |
Sorry, the diff of this file is not supported yet
456909
7468