Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

Simple quick reply button error [BUG]

Open IanosJunior opened this issue 1 year ago • 4 comments

Now a simple button message don't work. Only WhatsApp Web. image

const buttons = [
{buttonId: 'id1', buttonText: {displayText: 'Button 1'}, type: 1},
{buttonId: 'id2', buttonText: {displayText: 'Button 2'}, type: 1},
{buttonId: 'id3', buttonText: {displayText: 'Button 3'}, type: 1}
	]
	
	const buttonMessage = {
		text: "Hi it's button message",
		footer: 'Hello World',
		buttons: buttons,
		headerType: 1
	}
	
	const sendMsg = await sock.sendMessage(msg.key.remoteJid!, buttonMessage)

@adiwajshing

IanosJunior avatar Sep 20 '22 12:09 IanosJunior

This way works on IOS but don't work on web

ricocrivelli avatar Sep 20 '22 20:09 ricocrivelli

try remove footer

const buttons = [
{buttonId: 'id1', buttonText: {displayText: 'Button 1'}, type: 1},
{buttonId: 'id2', buttonText: {displayText: 'Button 2'}, type: 1},
{buttonId: 'id3', buttonText: {displayText: 'Button 3'}, type: 1}
	]
	
	const buttonMessage = {
		text: "Hi it's button message",
		// footer: 'Hello World',
		buttons: buttons,
		headerType: 1
	}
	
	const sendMsg = await sock.sendMessage(msg.key.remoteJid!, buttonMessage)

enoksaju avatar Sep 20 '22 21:09 enoksaju

image It returns an empty string... I'm away from my computer now to test on web.

ricocrivelli avatar Sep 20 '22 21:09 ricocrivelli

try send this object

{
    "text": "Hi it's button message",

    "buttons": [
        {"buttonId": "id1", "buttonText": {"displayText": "Button 1"}},
        {"buttonId": "id2", "buttonText": {"displayText": "Button 2"}},
        {"buttonId": "id3", "buttonText": {"displayText": "Button 3"}}
    ]
}

enoksaju avatar Sep 20 '22 21:09 enoksaju

try remove footer

const buttons = [
{buttonId: 'id1', buttonText: {displayText: 'Button 1'}, type: 1},
{buttonId: 'id2', buttonText: {displayText: 'Button 2'}, type: 1},
{buttonId: 'id3', buttonText: {displayText: 'Button 3'}, type: 1}
	]
	
	const buttonMessage = {
		text: "Hi it's button message",
		// footer: 'Hello World',
		buttons: buttons,
		headerType: 1
	}
	
	const sendMsg = await sock.sendMessage(msg.key.remoteJid!, buttonMessage)

Work fine!!! What's happening? Before it worked with the footer.

IanosJunior avatar Sep 21 '22 18:09 IanosJunior

Also try with empty footer like

const buttonMessage = {
		text: "Hi it's button message",
		footer: '',
		buttons: buttons, 
		headerType: 1

	} 

enoksaju avatar Sep 21 '22 18:09 enoksaju

I also have this issue removing footer works.

morganzysman avatar Sep 21 '22 20:09 morganzysman

This issue is stale because it has been open 6 days with no activity. Remove the stale label or comment or this will be closed in 2 days

github-actions[bot] avatar Sep 28 '22 04:09 github-actions[bot]