Skip to content

Commit

Permalink
feat(whatsapp.gblib): Image will be send as a message and md can be r…
Browse files Browse the repository at this point in the history
…ead easily on the phone.
  • Loading branch information
rodrigorodriguez committed Aug 24, 2019
1 parent faa5ec7 commit 2b4fb68
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ export class KBService {

let text = answer.content;

let sleep = (ms) => {
return new Promise(resolve => {
setTimeout(resolve, ms)
})
}

enum State {
InText,
InImage,
Expand Down Expand Up @@ -438,8 +444,9 @@ export class KBService {
if (c === '[') {
if (currentText !== '') {
await step.context.sendActivity(currentText);
await sleep(3000);
}

currentText = '';
state = State.InImageCaption;
}
Expand All @@ -463,6 +470,8 @@ export class KBService {
state = State.InText;
let url = urlJoin(GBServer.globals.publicAddress, currentImage);
await conversationalService.sendFile(min, step, url);
await sleep(5000);
currentImage = '';
}
else {
currentImage = currentImage.concat(c);
Expand Down

0 comments on commit 2b4fb68

Please sign in to comment.