Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send ListMessage #13

Closed
Alizee187 opened this issue Jun 17, 2022 · 3 comments
Closed

How to send ListMessage #13

Alizee187 opened this issue Jun 17, 2022 · 3 comments

Comments

@Alizee187
Copy link

i want to migrate my old pluggins here in MD, but i use a loot listMessage, and dont see "case MessageType.listMessage:
m.listMessage = WAMessageProto.ListMessage.fromObject(message)
" in simple.js (that menas, the bot not know when i use
await conn.sendListMessage(m.chat, { buttonText: 'Menu del casino!', description: 'MeduS.A-bot | CASINO\n\n Hola! Bienvenido al casino La medusa... toca el boton de abajo, y te dara varios comandos del casino!', title: 'CASINO!' },

what i can do? (bad english, sorry)

@hdiiofficial
Copy link

hdiiofficial commented Jun 19, 2022

i want to migrate my old pluggins here in MD, but i use a loot listMessage, and dont see "case MessageType.listMessage: m.listMessage = WAMessageProto.ListMessage.fromObject(message)" in simple.js (that menas, the bot not know when i use await conn.sendListMessage(m.chat, { buttonText: 'Menu del casino!', description: 'MeduS.A-bot | CASINO\n\n Hola! Bienvenido al casino La medusa... toca el boton de abajo, y te dara varios comandos del casino!', title: 'CASINO!' },

what i can do? (bad english, sorry)

const section = [
{
title: "Section 1",
rows: [
{title: "Option 1", rowId: "option1"},
{title: "Option 2", rowId: "option2", description: "This is a description"}
]
},
{
title: "Section 2",
rows: [
{title: "Option 3", rowId: "option3"},
{title: "Option 4", rowId: "option4", description: "This is a description V2"}
]
},
]

const listMessage = {
text: "This is a list",
footer: "nice footer, link: https://google.com",
title: "Amazing boldfaced list title",
buttonText: "Required, text on the button to view the list",
sections
}

await conn.sendMessage(id, listMessage)

In new version md u can use conn.sendMessage not conn.sendListMessage

@Alizee187
Copy link
Author

i want to migrate my old pluggins here in MD, but i use a loot listMessage, and dont see "case MessageType.listMessage: m.listMessage = WAMessageProto.ListMessage.fromObject(message)" in simple.js (that menas, the bot not know when i use await conn.sendListMessage(m.chat, { buttonText: 'Menu del casino!', description: 'MeduS.A-bot | CASINO\n\n Hola! Bienvenido al casino La medusa... toca el boton de abajo, y te dara varios comandos del casino!', title: 'CASINO!' },

what i can do? (bad english, sorry)

const section = [
{
title: "Section 1",
rows: [
{title: "Option 1", rowId: "option1"},
{title: "Option 2", rowId: "option2", description: "This is a description"}
]
},
{
title: "Section 2",
rows: [
{title: "Option 3", rowId: "option3"},
{title: "Option 4", rowId: "option4", description: "This is a description V2"}
]
},
]

const listMessage = {
text: "This is a list",
footer: "nice footer, link: https://google.com",
title: "Amazing boldfaced list title",
buttonText: "Required, text on the button to view the list",
sections
}

await conn.sendMessage(id, listMessage)

In new version md u can use conn.sendMessage not conn.sendListMessage

Not working.... I get this:

Error: Timed Out
at /root/medusav21/node_modules/@adiwajshing/baileys/lib/Utils/generics.js:174:32 {
data: {
stack: 'Error\n' +
' at promiseTimeout (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Utils/generics.js:169:19)\n' +
' at waitForMessage (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/socket.js:99:61)\n' +
' at query (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/socket.js:122:22)\n' +
' at getUSyncDevices (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:173:30)\n' +
' at /root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:324:53\n' +
' at Object.transaction (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.js:80:27)\n' +
' at relayMessage (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:260:30)\n' +
' at Object.sendMessage (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:415:23)\n' +
' at async Object.handler (/root/medusav21/plugins/test12.js:32:1)\n' +
' at async Object.handler (/root/medusav21/handler.js:770:25)'
},
isBoom: true,
isServer: false,
output: {
statusCode: 408,
payload: {
statusCode: 408,
error: 'Request Time-out',
message: 'Timed Out'
},
headers: {}
}
}

@hdiiofficial
Copy link

i want to migrate my old pluggins here in MD, but i use a loot listMessage, and dont see "case MessageType.listMessage: m.listMessage = WAMessageProto.ListMessage.fromObject(message)" in simple.js (that menas, the bot not know when i use await conn.sendListMessage(m.chat, { buttonText: 'Menu del casino!', description: 'MeduS.A-bot | CASINO\n\n Hola! Bienvenido al casino La medusa... toca el boton de abajo, y te dara varios comandos del casino!', title: 'CASINO!' },
what i can do? (bad english, sorry)

const section = [
{
title: "Section 1",
rows: [
{title: "Option 1", rowId: "option1"},
{title: "Option 2", rowId: "option2", description: "This is a description"}
]
},
{
title: "Section 2",
rows: [
{title: "Option 3", rowId: "option3"},
{title: "Option 4", rowId: "option4", description: "This is a description V2"}
]
},
]
const listMessage = {
text: "This is a list",
footer: "nice footer, link: https://google.com",
title: "Amazing boldfaced list title",
buttonText: "Required, text on the button to view the list",
sections
}
await conn.sendMessage(id, listMessage)
In new version md u can use conn.sendMessage not conn.sendListMessage

Not working.... I get this:

Error: Timed Out at /root/medusav21/node_modules/@adiwajshing/baileys/lib/Utils/generics.js:174:32 { data: { stack: 'Error\n' + ' at promiseTimeout (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Utils/generics.js:169:19)\n' + ' at waitForMessage (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/socket.js:99:61)\n' + ' at query (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/socket.js:122:22)\n' + ' at getUSyncDevices (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:173:30)\n' + ' at /root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:324:53\n' + ' at Object.transaction (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.js:80:27)\n' + ' at relayMessage (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:260:30)\n' + ' at Object.sendMessage (/root/medusav21/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:415:23)\n' + ' at async Object.handler (/root/medusav21/plugins/test12.js:32:1)\n' + ' at async Object.handler (/root/medusav21/handler.js:770:25)' }, isBoom: true, isServer: false, output: { statusCode: 408, payload: { statusCode: 408, error: 'Request Time-out', message: 'Timed Out' }, headers: {} } }

You can add me on your project for help

@Aiinne Aiinne closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants