Skip to content

Commit

Permalink
fix(bot): ⚡ endFlow butons
Browse files Browse the repository at this point in the history
  • Loading branch information
leifermendez committed Jan 29, 2023
2 parents 15b6418 + f6114af commit 87a4203
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions packages/bot/core/core.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,7 @@ class CoreClass {
endFlowFlag = true
if (message)
this.sendProviderAndSave(from, createCtxMessage(message))

clearQueue()
if (message)
this.sendProviderAndSave(from, {
...prevMsg,
answer: message ?? prevMsg.answer,
})
return
}

Expand Down Expand Up @@ -171,7 +165,14 @@ class CoreClass {
if (next) return continueFlow()
return this.sendProviderAndSave(from, {
...prevMsg,
answer: message ?? prevMsg.answer,
answer:
typeof message === 'string'
? message
: message?.body ?? prevMsg.answer,
options: {
...prevMsg.options,
buttons: message?.buttons ?? prevMsg.options?.buttons,
},
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/bot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bot-whatsapp/bot",
"version": "0.0.86-alpha.0",
"version": "0.0.91-alpha.0",
"description": "",
"main": "./lib/bundle.bot.cjs",
"scripts": {
Expand Down

0 comments on commit 87a4203

Please sign in to comment.