mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-21 04:59:15 +00:00
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/bot",
|
"name": "@bot-whatsapp/bot",
|
||||||
"version": "0.0.48-alpha.0",
|
"version": "0.0.49-alpha.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./lib/bundle.bot.cjs",
|
"main": "./lib/bundle.bot.cjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/cli",
|
"name": "@bot-whatsapp/cli",
|
||||||
"version": "0.0.55-alpha.0",
|
"version": "0.0.56-alpha.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "create-bot-whatsapp",
|
"name": "create-bot-whatsapp",
|
||||||
"version": "0.0.66-alpha.0",
|
"version": "0.0.67-alpha.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./lib/bundle.create-bot-whatsapp.cjs",
|
"main": "./lib/bundle.create-bot-whatsapp.cjs",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/database",
|
"name": "@bot-whatsapp/database",
|
||||||
"version": "0.0.47-alpha.0",
|
"version": "0.0.48-alpha.0",
|
||||||
"description": "Esto es el conector a mysql, pg, mongo",
|
"description": "Esto es el conector a mysql, pg, mongo",
|
||||||
"main": "./lib/mock/index.cjs",
|
"main": "./lib/mock/index.cjs",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/portal",
|
"name": "@bot-whatsapp/portal",
|
||||||
"version": "0.0.5-alpha.0",
|
"version": "0.0.6-alpha.0",
|
||||||
"description": "Portal WEB para escanear QR",
|
"description": "Portal WEB para escanear QR",
|
||||||
"main": "./lib/portal.http.cjs",
|
"main": "./lib/portal.http.cjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const { join } = require('path')
|
const { join } = require('path')
|
||||||
const { createReadStream, existsSync } = require('fs')
|
const { createReadStream, existsSync } = require('fs')
|
||||||
const { bgYellow, cyan } = require('kleur')
|
const { bgYellow, cyan, yellow } = require('kleur')
|
||||||
const polka = require('polka')
|
const polka = require('polka')
|
||||||
|
|
||||||
const HTTP_PORT = process.env.PORT || 3000
|
const HTTP_PORT = process.env.PORT || 3000
|
||||||
@@ -28,13 +28,28 @@ const start = (args) => {
|
|||||||
}
|
}
|
||||||
const { port, publicSite, name } = injectArgs
|
const { port, publicSite, name } = injectArgs
|
||||||
|
|
||||||
|
const banner = () => {
|
||||||
|
console.log(``)
|
||||||
|
console.log(bgYellow(`🚩 ESCANEAR QR 🚩`))
|
||||||
|
console.log(cyan(`Existen varias maneras de escanear el QR code`))
|
||||||
|
console.log(
|
||||||
|
cyan(`- Tambien puedes visitar `),
|
||||||
|
yellow(`${publicSite}:${port}`)
|
||||||
|
)
|
||||||
|
console.log(
|
||||||
|
cyan(`- Se ha creado un archivo que finaliza `),
|
||||||
|
yellow('qr.png')
|
||||||
|
)
|
||||||
|
console.log(``)
|
||||||
|
}
|
||||||
|
|
||||||
polka()
|
polka()
|
||||||
.use(serve)
|
.use(serve)
|
||||||
.get('qr.png', (_, res) => {
|
.get('qr.png', (_, res) => {
|
||||||
const qrSource = [
|
const qrSource = [
|
||||||
join(process.cwd(), `${name}.png`),
|
join(process.cwd(), `${name}.qr.png`),
|
||||||
join(__dirname, '..', `${name}.png`),
|
join(__dirname, '..', `${name}.qr.png`),
|
||||||
join(__dirname, `${name}.png`),
|
join(__dirname, `${name}.qr.png`),
|
||||||
].find((i) => existsSync(i))
|
].find((i) => existsSync(i))
|
||||||
|
|
||||||
const qrMark = [
|
const qrMark = [
|
||||||
@@ -42,17 +57,11 @@ const start = (args) => {
|
|||||||
join(__dirname, '..', 'dist', 'water-mark.png'),
|
join(__dirname, '..', 'dist', 'water-mark.png'),
|
||||||
].find((i) => existsSync(i))
|
].find((i) => existsSync(i))
|
||||||
const fileStream = createReadStream(qrSource ?? qrMark)
|
const fileStream = createReadStream(qrSource ?? qrMark)
|
||||||
|
|
||||||
res.writeHead(200, { 'Content-Type': 'image/png' })
|
res.writeHead(200, { 'Content-Type': 'image/png' })
|
||||||
fileStream.pipe(res)
|
fileStream.pipe(res)
|
||||||
})
|
})
|
||||||
.listen(port, () => {
|
.listen(port, () => banner())
|
||||||
console.log(``)
|
|
||||||
console.log(bgYellow(`🚩 ESCANEAR QR 🚩`))
|
|
||||||
console.log(cyan(`Existen varias maneras de escanear el QR code`))
|
|
||||||
console.log(cyan(`- Se ha creado un archivo /qr.png`))
|
|
||||||
console.log(cyan(`- Tambien puedes visitar ${publicSite}:${port}`))
|
|
||||||
console.log(``)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = start
|
module.exports = start
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/provider",
|
"name": "@bot-whatsapp/provider",
|
||||||
"version": "0.0.53-alpha.0",
|
"version": "0.0.54-alpha.0",
|
||||||
"description": "Esto es el conector a Twilio, Meta, etc...",
|
"description": "Esto es el conector a Twilio, Meta, etc...",
|
||||||
"main": "./lib/mock/index.cjs",
|
"main": "./lib/mock/index.cjs",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|||||||
@@ -89,14 +89,14 @@ class BaileysProvider extends ProviderClass {
|
|||||||
if (qr) {
|
if (qr) {
|
||||||
this.emit('require_action', {
|
this.emit('require_action', {
|
||||||
instructions: [
|
instructions: [
|
||||||
`Debes escanear el QR Code para iniciar session reivsa qr.png`,
|
`Debes escanear el QR Code para iniciar ${this.globalVendorArgs.name}.qr.png`,
|
||||||
`Recuerda que el QR se actualiza cada minuto `,
|
`Recuerda que el QR se actualiza cada minuto `,
|
||||||
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
await baileyGenerateImage(
|
await baileyGenerateImage(
|
||||||
qr,
|
qr,
|
||||||
`${this.globalVendorArgs.name}.png`
|
`${this.globalVendorArgs.name}.qr.png`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -38,10 +38,13 @@ class VenomProvider extends ProviderClass {
|
|||||||
{
|
{
|
||||||
session: NAME_DIR_SESSION,
|
session: NAME_DIR_SESSION,
|
||||||
multidevice: true,
|
multidevice: true,
|
||||||
|
disableSpins: true,
|
||||||
|
disableWelcome: true,
|
||||||
|
logger,
|
||||||
|
logQR: false,
|
||||||
},
|
},
|
||||||
(base) => this.generateQr(base),
|
(base) => this.generateQr(base),
|
||||||
undefined,
|
undefined
|
||||||
{ logQR: false }
|
|
||||||
)
|
)
|
||||||
this.vendor = client
|
this.vendor = client
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -64,12 +67,12 @@ class VenomProvider extends ProviderClass {
|
|||||||
console.clear()
|
console.clear()
|
||||||
this.emit('require_action', {
|
this.emit('require_action', {
|
||||||
instructions: [
|
instructions: [
|
||||||
`Debes escanear el QR Code para iniciar session reivsa qr.png`,
|
`Debes escanear el QR Code para iniciar ${this.globalVendorArgs.name}.qr.png`,
|
||||||
`Recuerda que el QR se actualiza cada minuto `,
|
`Recuerda que el QR se actualiza cada minuto `,
|
||||||
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
await venomGenerateImage(qr, `${this.globalVendorArgs.name}.png`)
|
await venomGenerateImage(qr, `${this.globalVendorArgs.name}.qr.png`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -72,12 +72,15 @@ class WebWhatsappProvider extends ProviderClass {
|
|||||||
func: async (qr) => {
|
func: async (qr) => {
|
||||||
this.emit('require_action', {
|
this.emit('require_action', {
|
||||||
instructions: [
|
instructions: [
|
||||||
`Debes escanear el QR Code para iniciar session reivsa qr.png`,
|
`Debes escanear el QR Code para iniciar ${this.globalVendorArgs.name}.qr.png`,
|
||||||
`Recuerda que el QR se actualiza cada minuto `,
|
`Recuerda que el QR se actualiza cada minuto `,
|
||||||
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
await wwebGenerateImage(qr, `${this.globalVendorArgs.name}.png`)
|
await wwebGenerateImage(
|
||||||
|
qr,
|
||||||
|
`${this.globalVendorArgs.name}.qr.png`
|
||||||
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user