Skip to content

Commit

Permalink
chore: next-0.1.25
Browse files Browse the repository at this point in the history
chore: next-0.1.25
  • Loading branch information
leifermendez committed Mar 4, 2023
2 parents 12223ba + 021a842 commit d1bff8b
Show file tree
Hide file tree
Showing 18 changed files with 667 additions and 128 deletions.
1 change: 1 addition & 0 deletions packages/bot/core/core.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class CoreClass {
const refToContinue = this.flowClass.findBySerialize(prevMsg?.refSerialize)

if (prevMsg?.ref) {
delete prevMsg._id
const ctxByNumber = toCtx({
body,
from,
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/configuration/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const PROVIDER_LIST = [
{ value: 'baileys', label: 'Baileys', hint: 'gratis' },
{ value: 'venom', label: 'Venom', hint: 'gratis' },
{ value: 'wweb', label: 'whatsapp-web.js', hint: 'gratis' },
{ value: 'wppconnect', label: 'WPPConnect', hint: 'gratis' },
{ value: 'wweb', label: 'Whatsapp-web.js', hint: 'gratis' },
{ value: 'twilio', label: 'Twilio' },
{ value: 'meta', label: 'Meta' },
]
Expand Down
4 changes: 2 additions & 2 deletions packages/provider/common/download.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const mimeDep = require('mime-types')
const { tmpdir } = require('os')
const http = require('http')
const https = require('https')
const http = require('follow-redirects').http
const https = require('follow-redirects').https
const { rename, createWriteStream } = require('fs')

/**
Expand Down
8 changes: 6 additions & 2 deletions packages/provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
],
"dependencies": {
"@bot-whatsapp/bot": "*",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"combine-image": "^1.0.3",
"fluent-ffmpeg": "^2.1.2",
"qr-image": "^3.2.0",
"rimraf": "^3.0.2",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"fluent-ffmpeg": "^2.1.2"
"sharp": "^0.30.5"
},
"exports": {
"./mock": "./lib/mock/index.cjs",
Expand All @@ -29,5 +30,8 @@
"repository": {
"type": "git",
"url": "https://github.com/codigoencasa/bot-whatsapp/tree/main/packages/provider"
},
"devDependencies": {
"follow-redirects": "^1.15.2"
}
}
6 changes: 4 additions & 2 deletions packages/provider/src/baileys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class BaileysProvider extends ProviderClass {
}

//Detectar location
if (messageCtx.message.locationMessage) {
if (messageCtx.message?.locationMessage) {
const { degreesLatitude, degreesLongitude } = messageCtx.message.locationMessage
if (typeof degreesLatitude === 'number' && typeof degreesLongitude === 'number') {
payload = { ...payload, body: generateRefprovider('_event_location_') }
Expand Down Expand Up @@ -156,9 +156,11 @@ class BaileysProvider extends ProviderClass {
}

const btnCtx = payload?.message?.buttonsResponseMessage?.selectedDisplayText

if (btnCtx) payload.body = btnCtx

const listRowId = payload?.message?.listResponseMessage?.singleSelectReply?.selectedRowId
if (listRowId) payload.body = listRowId

payload.from = baileyCleanNumber(payload.from, true)
this.emit('message', payload)
},
Expand Down
Loading

0 comments on commit d1bff8b

Please sign in to comment.