Comments (5)
let fs = require('fs')
let { MessageType } = require('@adiwajshing/baileys')
let handler = async (m, { conn, usedPrefix }) => {
let txt = 'test the button images'
const buttons = [
{buttonId:/menu
, buttonText: {displayText: 'MENU'}, type: 1},
{buttonId:/ping
, buttonText: {displayText: 'PING'}, type: 1}
]
const media = await conn.prepareMessageMedia(fs.readFileSync('./src/example.jpeg'), MessageType.image)
const buttonMessage = {
contentText: txt,
footerText: '©games-wabot',
buttons: buttons,
headerType: 4,
imageMessage: media,
}
return conn.sendMessage(m.chat, buttonMessage, MessageType.buttonsMessage, { quoted: m })}
handler.command = /^buttimage/i
module.exports = handlerfull codes
const fs = require('fs')
let handler = async (m, { conn, usedPrefix }) => {
let txt = 'test the button images'
const buttons = [
['MENU', '/menu'],
['PING', '/ping']
]
return conn.sendButton(m.chat, txt, '©games-wabot', fs.readFileSync('./src/example.jpeg'), buttons, { quoted: m })
}
from games-wabot.
ERROR SENDING BUTTON IMAGE so i decided to add button message with image headerType: 4 but suddenly i got error and error again i didn't know why the heck this can't run the image message button.
i try running it on vps and termux.
BaileysError: Unexpected status in 'action': Bad Request(400)
at WAConnection.query (/data/data/com.termux/files/home/games-wabot/node_modules/@adiwajshing/baileys/lib/WAConnection/0.Base.js:237:27)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async WAConnection.relayWAMessage (/data/data/com.termux/files/home/games-wabot/node_modules/@adiwajshing/baileys/lib/WAConnection/6.MessagesSend.js:315:13)
at async WAConnection.sendMessage (/data/data/com.termux/files/home/games-wabot/node_modules/@adiwajshing/baileys/lib/WAConnection/6.MessagesSend.js:25:9)
at async WAConnection.handler (/data/data/com.termux/files/home/games-wabot/handler.js:383:13) {
status: 400,
context: {
query: [ 'action', [Object], [Array] ],
message: 'Bad Request',
status: 400
}
}then i try it on my desktop i got same error 😕
Your code?
from games-wabot.
ERROR SENDING BUTTON IMAGE so i decided to add button message with image headerType: 4 but suddenly i got error and error again i didn't know why the heck this can't run the image message button.
i try running it on vps and termux.BaileysError: Unexpected status in 'action': Bad Request(400)
at WAConnection.query (/data/data/com.termux/files/home/games-wabot/node_modules/@adiwajshing/baileys/lib/WAConnection/0.Base.js:237:27)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async WAConnection.relayWAMessage (/data/data/com.termux/files/home/games-wabot/node_modules/@adiwajshing/baileys/lib/WAConnection/6.MessagesSend.js:315:13)
at async WAConnection.sendMessage (/data/data/com.termux/files/home/games-wabot/node_modules/@adiwajshing/baileys/lib/WAConnection/6.MessagesSend.js:25:9)
at async WAConnection.handler (/data/data/com.termux/files/home/games-wabot/handler.js:383:13) {
status: 400,
context: {
query: [ 'action', [Object], [Array] ],
message: 'Bad Request',
status: 400
}
}then i try it on my desktop i got same error 😕
Your code?
let handler = async (m, { conn, usedPrefix }) => {
let txt = 'test the button images'
const buttons = [
{buttonId:/menu
, buttonText: {displayText: 'MENU'}, type: 1},
{buttonId:/ping
, buttonText: {displayText: 'PING'}, type: 1}
]
const media = await conn.prepareMessageMedia(fs.readFileSync('./src/example.jpeg'), MessageType.image)
const buttonMessage = {
contentText: txt,
footerText: '©games-wabot',
buttons: buttons,
headerType: 4,
imageMessage: media,
}
return conn.sendMessage(m.chat, buttonMessage, MessageType.buttonsMessage, { quoted: m })
}
from games-wabot.
let fs = require('fs')
let { MessageType } = require('@adiwajshing/baileys')
let handler = async (m, { conn, usedPrefix }) => {
let txt = 'test the button images'
const buttons = [
{buttonId:/menu
, buttonText: {displayText: 'MENU'}, type: 1},
{buttonId:/ping
, buttonText: {displayText: 'PING'}, type: 1}
]
const media = await conn.prepareMessageMedia(fs.readFileSync('./src/example.jpeg'), MessageType.image)
const buttonMessage = {
contentText: txt,
footerText: '©games-wabot',
buttons: buttons,
headerType: 4,
imageMessage: media,
}
return conn.sendMessage(m.chat, buttonMessage, MessageType.buttonsMessage, { quoted: m })
}
handler.command = /^buttimage/i
module.exports = handler
full codes
from games-wabot.
i forgot to read the simple.js 😂 thanks man.
from games-wabot.
Related Issues (20)
- SyntaxError: Unexpected reserved word HOT 1
- gabisa di deploy di heroku
- not working, I cant loggin. HOT 2
- (MD) FITUR BEBERAPA YANG EROR. HOT 1
- [MD] tiktok downloader error
- Unexpected server response: 404
- Node modules adiwajshing “cannot find modul” padahal udah update dan install HOT 3
- [MD] unbanchat tidak bisa HOT 2
- QR code tidak muncul HOT 1
- Menu support for new version WhatsApp HOT 2
- Found bug on Menu.js
- Cannot find module 'cfonts' HOT 1
- database
- unbanchat doesn't works
- conn.sendHydrated HOT 3
- [MD] npm i ga bekerja
- Menu gak muncul
- How to fix this fix error? HOT 1
- Cara mengubah fkontak gimana?
- Ga bisa install npm i sama yarn
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from games-wabot.