fix(all): /check added.
This commit is contained in:
parent
68369c24ad
commit
7410085e99
3 changed files with 22 additions and 7 deletions
|
@ -58,6 +58,15 @@ export class QualityDialog extends IGBDialog {
|
||||||
public static setup(bot: BotAdapter, min: GBMinInstance) {
|
public static setup(bot: BotAdapter, min: GBMinInstance) {
|
||||||
const service = new CSService();
|
const service = new CSService();
|
||||||
|
|
||||||
|
min.dialogs.add(new WaterfallDialog('/check', [
|
||||||
|
async step => {
|
||||||
|
const locale = step.context.activity.locale;
|
||||||
|
await min.conversationalService.sendText(min, step, Messages[locale].check_whatsapp_ok);
|
||||||
|
return await step.replaceDialog('/ask', { isReturning: true });
|
||||||
|
}
|
||||||
|
]
|
||||||
|
));
|
||||||
|
|
||||||
min.dialogs.add(new WaterfallDialog('/quality', [
|
min.dialogs.add(new WaterfallDialog('/quality', [
|
||||||
async step => {
|
async step => {
|
||||||
const locale = step.context.activity.locale;
|
const locale = step.context.activity.locale;
|
||||||
|
|
|
@ -12,7 +12,8 @@ export const Messages = {
|
||||||
please_no_bad_words: 'Please, no bad words.',
|
please_no_bad_words: 'Please, no bad words.',
|
||||||
please_wait_transfering: 'Please, wait while I find an agent to answer you.',
|
please_wait_transfering: 'Please, wait while I find an agent to answer you.',
|
||||||
notify_agent: (name) => `New call available for *${name}*, you can answer right here when you are finished, type /qt.`,
|
notify_agent: (name) => `New call available for *${name}*, you can answer right here when you are finished, type /qt.`,
|
||||||
notify_end_transfer: (botName) => `Now talking to ${botName} again.`
|
notify_end_transfer: (botName) => `Now talking to ${botName} again.`,
|
||||||
|
check_whatsapp_ok: 'If you are seeing this message, WhatsApp API is OK.',
|
||||||
},
|
},
|
||||||
'pt-BR': {
|
'pt-BR': {
|
||||||
about_suggestions: 'Sugestões melhoram muito minha qualidade...',
|
about_suggestions: 'Sugestões melhoram muito minha qualidade...',
|
||||||
|
@ -26,7 +27,7 @@ export const Messages = {
|
||||||
please_no_bad_words: 'Por favor, sem palavrões!',
|
please_no_bad_words: 'Por favor, sem palavrões!',
|
||||||
please_wait_transfering: 'Por favor, aguarde enquanto eu localizo alguém para te atender.',
|
please_wait_transfering: 'Por favor, aguarde enquanto eu localizo alguém para te atender.',
|
||||||
notify_agent: (name) => `Existe um novo atendimento para *${name}*, por favor, responda aqui mesmo para a pessoa. Para finalizar, digite /qt.`,
|
notify_agent: (name) => `Existe um novo atendimento para *${name}*, por favor, responda aqui mesmo para a pessoa. Para finalizar, digite /qt.`,
|
||||||
notify_end_transfer: (botName) => `Falando novamente com o bot ${botName}.`
|
notify_end_transfer: (botName) => `Falando novamente com o bot ${botName}.`,
|
||||||
|
check_whatsapp_ok: 'Se você está recebendo esta mensagem, significa que a API do WhatsApp está OK.',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,6 +36,8 @@ const { promisify } = require('util');
|
||||||
import { GBLog, GBMinInstance, GBService } from 'botlib';
|
import { GBLog, GBMinInstance, GBService } from 'botlib';
|
||||||
import { GBServer } from '../../../src/app';
|
import { GBServer } from '../../../src/app';
|
||||||
import { SecService } from '../../security.gbapp/services/SecService';
|
import { SecService } from '../../security.gbapp/services/SecService';
|
||||||
|
const hubspot = require('@hubspot/api-client');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for Hub Spot XRM.
|
* Support for Hub Spot XRM.
|
||||||
|
@ -69,7 +71,6 @@ export class HubSpotServices extends GBService {
|
||||||
|
|
||||||
public async getActiveTasks(): Promise<[]> {
|
public async getActiveTasks(): Promise<[]> {
|
||||||
|
|
||||||
const hubspot = require('@hubspot/api-client');
|
|
||||||
const client = new hubspot.Client({ apiKey: this.key });
|
const client = new hubspot.Client({ apiKey: this.key });
|
||||||
let properties = ['hs_task_subject', 'hubspot_owner_id', 'hs_task_status', 'hs_task_priority'];
|
let properties = ['hs_task_subject', 'hubspot_owner_id', 'hs_task_status', 'hs_task_priority'];
|
||||||
const pageSize = 100;
|
const pageSize = 100;
|
||||||
|
@ -87,8 +88,12 @@ export class HubSpotServices extends GBService {
|
||||||
let final;
|
let final;
|
||||||
final = [];
|
final = [];
|
||||||
list.forEach(e => {
|
list.forEach(e => {
|
||||||
if (e.properties.hs_task_status === "NOT_STARTED")
|
if (e.properties.hs_task_status === "NOT_STARTED") {
|
||||||
{
|
e['status'] = e.properties.hs_task_status;
|
||||||
|
e['title'] = e.properties.hs_task_subject;
|
||||||
|
e['ownerId'] = e.properties.hubspot_owner_id;
|
||||||
|
e['priority'] = e.properties.hs_task_priority;
|
||||||
|
|
||||||
final.push(e);
|
final.push(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue