From af958d02221afcbabf8613445b8cabf464c359a4 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 20 Aug 2024 21:22:33 -0400 Subject: [PATCH] wip --- lib/tasks/dialogflow/index.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/tasks/dialogflow/index.js b/lib/tasks/dialogflow/index.js index e2990a66..d78c95d4 100644 --- a/lib/tasks/dialogflow/index.js +++ b/lib/tasks/dialogflow/index.js @@ -91,7 +91,7 @@ class Dialogflow extends Task { this.logger.info('Dialogflow:exec'); await this.init(cs, ep); this.logger.info('Dialogflow:exec - initialized'); - await this.startBot(); + await this.startBot(ep); this.logger.info('Dialogflow:exec - started bot'); await this.awaitTaskDone(); this.logger.info('Dialogflow:exec - done'); @@ -165,28 +165,28 @@ class Dialogflow extends Task { } } - async startBot() { + async startBot(ep) { const fn = this.isCX ? this.startBotCX : this.startBotES; - await fn(); + await fn(ep); } - async startBotES() { + async startBotES(ep) { this.logger.info('starting dialogflow ES bot'); - const baseArgs = `${this.ep.uuid} ${this.project} ${this.lang} ${this.welcomeEvent}`; + const baseArgs = `${ep.uuid} ${this.project} ${this.lang} ${this.welcomeEvent}`; if (this.welcomeEventParams) { - await this.ep.api(this.cmd, `${baseArgs} '${JSON.stringify(this.welcomeEventParams)}'`); + await ep.api(this.cmd, `${baseArgs} '${JSON.stringify(this.welcomeEventParams)}'`); } else if (this.welcomeEvent.length) { - await this.ep.api(this.cmd, baseArgs); + await ep.api(this.cmd, baseArgs); } else { - await this.ep.api(this.cmd, `${this.ep.uuid} ${this.project} ${this.lang}`); + await ep.api(this.cmd, `${this.ep.uuid} ${this.project} ${this.lang}`); } } - async startBotCX() { + async startBotCX(ep) { const baseArgs = [ - this.ep.uuid, + ep.uuid, this.region, this.project, this.agent, @@ -198,7 +198,7 @@ class Dialogflow extends Task { } this.logger.info({args: baseArgs}, 'starting dialogflow CX bot'); - await this.ep.api(this.cmd, `${baseArgs.join(' ')}`); + await ep.api(this.cmd, `${baseArgs.join(' ')}`); } /**