Baileys
Baileys copied to clipboard
how to get function of groupInviteMessage
How??? I Dont Know! Please tell me
I'm stuck on this too.
I made this:
var linkgc = await conn.groupInviteCode(from)
dest ='[email protected]'
const invit = generateWAMessageFromContent(dest, proto.Message.fromObject({
groupInviteMessage: {
groupJid: '[email protected]',
inviteCode: linkgc,
inviteExpiration: "1663436013",
groupName: ${groupName}
,
caption: 'Get in'
}
}), { userJid: dest })
await conn.relayMessage(dest, invit.message, { messageId: invit.key.dest})
but the inviteCode doesn't work, and IDK how to generate a valid one :/
async value(jid, participant, inviteCode, inviteExpiration, groupName = 'unknown subject', caption = 'Invitation to join my WhatsApp group', jpegThumbnail, options = {}) { const msg = proto.Message.fromObject({ groupInviteMessage: proto.GroupInviteMessage.fromObject({ inviteCode, inviteExpiration: parseInt(inviteExpiration) || + new Date(new Date + (3 * 8600000)), groupJid: jid, groupName: (groupName ? groupName : await conn.getName(jid)) || null, jpegThumbnail: Buffer.isBuffer(jpegThumbnail) ? jpegThumbnail.toString('base64') : null, caption }) }) const message = generateWAMessageFromContent(participant, msg, options) await conn.relayMessage(participant, message.message, { messageId: message.key.id, additionalAttributes: { ...options } }) return message }
I'm stuck on this too.
I made this:
var linkgc = await conn.groupInviteCode(from) dest ='[email protected]' const invit = generateWAMessageFromContent(dest, proto.Message.fromObject({ groupInviteMessage: { groupJid: '[email protected]', inviteCode: linkgc, inviteExpiration: "1663436013", groupName:
${groupName}
, caption: 'Get in' } }), { userJid: dest }) await conn.relayMessage(dest, invit.message, { messageId: invit.key.dest})but the inviteCode doesn't work, and IDK how to generate a valid one :/
a valid invitation code is generated when trying to add a person and that person has the option of being added to a group deactivated, you can extract the option to add from the baileys code, since that is where the valid code comes from, I don't know if I make myself understood
I'm stuck on this too.
I made this:
var linkgc = await conn.groupInviteCode(from) dest ='[email protected]' const invit = generateWAMessageFromContent(dest, proto.Message.fromObject({ groupInviteMessage: { groupJid: '[email protected]', inviteCode: linkgc, inviteExpiration: "1663436013", groupName:
${groupName}
, caption: 'Get in' } }), { userJid: dest }) await conn.relayMessage(dest, invit.message, { messageId: invit.key.dest})but the inviteCode doesn't work, and IDK how to generate a valid one :/
a valid invitation code is generated when trying to add a person and that person has the option of being added to a group deactivated, you can extract the option to add from the baileys code, since that is where the valid code comes from, I don't know if I make myself understood
Hmm, ok I got it. I'll try, thx.
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