Aiinne / Aine-MD

Free to use and not for sale. This repo uses scrape or data.json
https://aiinne.github.io/
GNU General Public License v3.0
135 stars 1.08k forks source link

How to send ListMessage #13

Closed Alizee187 closed 2 years ago

Alizee187 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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