Skip to content

Commit

Permalink
Update invert buttons statements
Browse files Browse the repository at this point in the history
  • Loading branch information
schwasa authored Feb 4, 2024
1 parent 1963600 commit 3d12fa6
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,18 @@ app.post('/webhook', async (req, res) => {
})
}
} else {
if (
if (req.body.entry[0].changes[0].value.messages[0].type === "button"
) {
await interact(
user_id,
{
type: 'text',
payload: req.body.entry[0].changes[0].value.messages[0].button.payload,
},
phone_number_id,
user_name
)
} else if (
req.body.entry[0].changes[0].value.messages[0].interactive.button_reply.id.includes(
'path-'
)
Expand All @@ -151,20 +162,7 @@ app.post('/webhook', async (req, res) => {
phone_number_id,
user_name
)
} else if (
req.body.entry[0].changes[0].value.messages[0].type === "button"
) {
await interact(
user_id,
{
type: 'text',
payload: req.body.entry[0].changes[0].value.messages[0].button.payload,
},
phone_number_id,
user_name
)
}
else {
} else {
await interact(
user_id,
{
Expand Down

0 comments on commit 3d12fa6

Please sign in to comment.