Skip to content

Commit

Permalink
fix(core.gbapp): Check for bot before creation process.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Apr 15, 2020
1 parent 41b7837 commit 094eb0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/core.gbapp/services/GBDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/kb.gbapp/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?'
}
};

0 comments on commit 094eb0f

Please sign in to comment.