fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
2 changed files with 22 additions and 13 deletions
Showing only changes of commit d20c2f7742 - Show all commits

View file

@ -1093,7 +1093,7 @@ export class DialogKeywords {
});
if (result === null) {
await this.talk({ pid, text: `Escolha por favor um dos itens sugeridos.` });
await this.talk({ pid, text: `Escolha por favor um dos itens sugeridos (${args.join(',')}).` });
return await this.hear({ pid, kind, args });
}
} else if (kind === 'language') {

View file

@ -1212,6 +1212,7 @@ export class GBMinService {
}
private async handleUploads(min, step, user, params, autoSave) {
// Prepare Promises to download each attachment and then execute each Promise.
if (
@ -1228,19 +1229,21 @@ export class GBMinService {
// In case of not having HEAR activated before, it is
// a upload with no Dialog, so run Auto Save to .gbdrive.
const t = new SystemKeywords();
GBLog.info(`BASIC (${min.botId}): Upload done for ${attachmentData.fileName}.`);
const handle = WebAutomationServices.cyrb53(min.botId + attachmentData.fileName);
let data = Fs.readFileSync(attachmentData.localPath);
const gbfile = {
filename: attachmentData.localPath,
data: data,
name: Path.basename(attachmentData.fileName)
};
GBServer.globals.files[handle] = gbfile;
if (!min.cbMap[user.userId] && autoSave) {
const t = new SystemKeywords();
GBLog.info(`BASIC (${min.botId}): Upload done for ${attachmentData.fileName}.`);
const handle = WebAutomationServices.cyrb53(min.botId + attachmentData.fileName);
let data = Fs.readFileSync(attachmentData.localPath);
const gbfile = {
filename: attachmentData.localPath,
data: data,
name: Path.basename(attachmentData.fileName)
};
GBServer.globals.files[handle] = gbfile;
const result = await t['internalAutoSave']({ min: min, handle: handle });
await min.conversationalService.sendText(
min,
@ -1250,6 +1253,12 @@ export class GBMinService {
return;
}
else
{
return gbfile;
}
} else {
await this.sendActivity('Error uploading file. Please,start again.');
}