fix(core.gbapp): Text improvements in messages.

This commit is contained in:
Rodrigo Rodriguez 2020-12-14 09:28:12 -03:00
parent 46f4cac29b
commit f739c15431
3 changed files with 175 additions and 167 deletions

View file

@ -128,6 +128,8 @@ class SysClass {
const botId = this.min.instance.botId;
const path = `/${botId}.gbai/${botId}.gbdata`;
address = address.indexOf(':') !== -1 ? address : address + ":" + address;
let res = await client
.api(`https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}/drive/root:${path}:/children`)
.get();
@ -143,9 +145,15 @@ class SysClass {
let body = { values: [[]] };
body.values[0][0] = value;
let sheets = await client
.api(
`https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}/drive/items/${document[0].id}/workbook/worksheets`
)
.get();
await client
.api(
`https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}/drive/items/${document[0].id}/workbook/worksheets('Sheet1')/range(address='${address}')`
`https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}/drive/items/${document[0].id}/workbook/worksheets('${sheets.value[0].name}')/range(address='${address}')`
)
.patch(body);
}

View file

@ -21,7 +21,7 @@ export const Messages = {
wider_answer: subjectText =>
`Vou te responder de modo mais abrangente... Não apenas sobre ${subjectText}`,
which_question: 'Qual a pergunta?',
anything_else: 'Então, posso ajudar em algo mais?',
anything_else: 'Posso ajudar em algo mais?',
here_is_subjects: 'Aqui estão algumas categorias de assuntos...',
menu_select: 'Selecionar',
lets_search: query =>

View file

@ -166,7 +166,7 @@ export class WhatsappDirectLine extends GBService {
}
GBLog.info(`GBWhatsapp: RCV ${from}(${fromName}): ${text})`);
await CollectionUtil.asyncForEach(this.min.appPackages, async (e:IGBPackage) => {
await CollectionUtil.asyncForEach(this.min.appPackages, async (e: IGBPackage) => {
await e.onExchangeData(this.min, "whatsappMessage", message);
});
@ -252,7 +252,7 @@ export class WhatsappDirectLine extends GBService {
}
}
else if (user.agentMode === "bot" || user.agentMode === null) {
else if (user.agentMode === "bot" || user.agentMode === null || user.agentMode === undefined) {
if (WhatsappDirectLine.conversationIds[from] === undefined) {
GBLog.info(`GBWhatsapp: Starting new conversation on Bot.`);