fix(core.gbapp): Check for bot before creation process.

This commit is contained in:
Rodrigo Rodriguez 2020-04-15 20:56:28 -03:00
parent 41b783775c
commit 094eb0f234
3 changed files with 6 additions and 2 deletions

View file

@ -184,6 +184,10 @@ export class GBDeployer implements IGBDeployer {
return await this.deployBotFull(instance, GBServer.globals.publicAddress);
}
public async botExists(instance: IGBInstance, group, publicAddress: string): Promise<boolean> {
const service = new AzureDeployerService(this);
return await service.botExists(instance.botId, group);
}
/**
* Deploys a bot to the storage.
*/

View file

@ -151,7 +151,7 @@ export class GBMinService {
if (user === null) {
user = await sec.ensureUser(activeMin.instance.instanceId, id,
activeMin.botId, id, "", "whatsapp", id, id);
await (activeMin as any).whatsAppDirectLine.sendToDevice(id, `Olá! Seja bem-vinda(o)!\nMe chamo ${activeMin.instance.title}. Como posso ajudar?`);
await (activeMin as any).whatsAppDirectLine.sendToDevice(id, `Olá! Seja bem-vinda(o)!\nMe chamo ${activeMin.instance.title}. Como posso ajudar? Pode me falar que eu te ouço, me manda um aúdio.`);
res.end();
} else {
// User wants to switch bots.

View file

@ -32,6 +32,6 @@ export const Messages = {
'Veja algumas perguntas mais frequentes logo na tela. Clique numa delas para eu responder.',
will_answer_projector:
'Vou te responder na tela para melhor visualização...',
ask_first_time: 'Sobre como eu poderia ajudar?'
ask_first_time: 'Como eu posso ajudar?'
}
};