feat(whatsapp.gblib): Image will be send as a message and md can be read easily on the phone.
This commit is contained in:
parent
faa5ec710c
commit
2b4fb68022
1 changed files with 10 additions and 1 deletions
|
@ -409,6 +409,12 @@ export class KBService {
|
||||||
|
|
||||||
let text = answer.content;
|
let text = answer.content;
|
||||||
|
|
||||||
|
let sleep = (ms) => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(resolve, ms)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
InText,
|
InText,
|
||||||
InImage,
|
InImage,
|
||||||
|
@ -438,6 +444,7 @@ export class KBService {
|
||||||
if (c === '[') {
|
if (c === '[') {
|
||||||
if (currentText !== '') {
|
if (currentText !== '') {
|
||||||
await step.context.sendActivity(currentText);
|
await step.context.sendActivity(currentText);
|
||||||
|
await sleep(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentText = '';
|
currentText = '';
|
||||||
|
@ -463,6 +470,8 @@ export class KBService {
|
||||||
state = State.InText;
|
state = State.InText;
|
||||||
let url = urlJoin(GBServer.globals.publicAddress, currentImage);
|
let url = urlJoin(GBServer.globals.publicAddress, currentImage);
|
||||||
await conversationalService.sendFile(min, step, url);
|
await conversationalService.sendFile(min, step, url);
|
||||||
|
await sleep(5000);
|
||||||
|
currentImage = '';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
currentImage = currentImage.concat(c);
|
currentImage = currentImage.concat(c);
|
||||||
|
|
Loading…
Add table
Reference in a new issue