Nurutomo / wabot-aq

WhatsApp Bot
GNU General Public License v3.0
691 stars 1.38k forks source link

Mau nambahin button message g bisa #711

Closed rizxyu closed 2 years ago

rizxyu commented 3 years ago

Oy. Bang gw mau uplod file send Message Button tapi kok g bisa ya?

ariffb25 commented 3 years ago

kodenya?

ini aja tinggal pake https://github.com/ariffb25/stikerinbot

ilhamimut commented 3 years ago

Oy. Bang gw mau uplod file send Message Button tapi kok g bisa ya?

coba ini:

let { MessageType } = require('@adiwajshing/baileys') const { sticker } = require('../lib/sticker') let fs = require('fs')

const buttons = [ {buttonId: '.menu', buttonText: {displayText: 'MENU'}, type: 1}, {buttonId: '.limit', buttonText: {displayText: 'LIMIT'}, type: 1}, ]

const buttonMessage = { contentText: "Ada yang bisa dibantu? \nTekan MENU", footerText: 'test doang', buttons: buttons, headerType: 1 }

let handler = async (m, { conn }) => { conn.sendMessage(m.chat, buttonMessage, MessageType.buttonsMessage, {quoted : m} ) }

handler.customPrefix = /^bot$|halo$|/i // ketik bot atau halo (tanpa prefix) handler.command = new RegExp

handler.owner = false handler.mods = false handler.premium = false handler.group = false handler.private = false

handler.admin = false handler.botAdmin = false

handler.fail = null

module.exports = handler

simpan file dengan nama terserah.js

Lilithxdef commented 3 years ago

Oy. Bang gw mau uplod file send Message Button tapi kok g bisa ya?

coba ini:

let { MessageType } = require('@adiwajshing/baileys') const { sticker } = require('../lib/sticker') let fs = require('fs')

const buttons = [ {buttonId: '.menu', buttonText: {displayText: 'MENU'}, type: 1}, {buttonId: '.limit', buttonText: {displayText: 'LIMIT'}, type: 1}, ]

const buttonMessage = { contentText: "Ada yang bisa dibantu? \nTekan MENU", footerText: 'test doang', buttons: buttons, headerType: 1 }

let handler = async (m, { conn }) => { conn.sendMessage(m.chat, buttonMessage, MessageType.buttonsMessage, {quoted : m} ) }

handler.customPrefix = /^bot$|halo$|/i // ketik bot atau halo (tanpa prefix) handler.command = new RegExp

handler.owner = false handler.mods = false handler.premium = false handler.group = false handler.private = false

handler.admin = false handler.botAdmin = false

handler.fail = null

module.exports = handler

simpan file dengan nama terserah.js

Pas dipencet g ngerespon ngab