mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat(feature/group-invite-v4): initial/final commit (#958)
This commit is contained in:
@@ -394,6 +394,25 @@ export const generateWAMessageContent = async(
|
||||
(message.disappearingMessagesInChat ? WA_DEFAULT_EPHEMERAL : 0) :
|
||||
message.disappearingMessagesInChat
|
||||
m = prepareDisappearingMessageSettingContent(exp)
|
||||
} else if('groupInvite' in message) {
|
||||
m.groupInviteMessage = {}
|
||||
m.groupInviteMessage.inviteCode = message.groupInvite.inviteCode
|
||||
m.groupInviteMessage.inviteExpiration = message.groupInvite.inviteExpiration
|
||||
m.groupInviteMessage.caption = message.groupInvite.text
|
||||
|
||||
m.groupInviteMessage.groupJid = message.groupInvite.jid
|
||||
m.groupInviteMessage.groupName = message.groupInvite.subject
|
||||
//TODO: use built-in interface and get disappearing mode info etc.
|
||||
//TODO: cache / use store!?
|
||||
if(options.getProfilePicUrl) {
|
||||
const pfpUrl = await options.getProfilePicUrl(message.groupInvite.jid, 'preview')
|
||||
if(pfpUrl) {
|
||||
const resp = await axios.get(pfpUrl, { responseType: 'arraybuffer' })
|
||||
if(resp.status === 200) {
|
||||
m.groupInviteMessage.jpegThumbnail = resp.data
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if('pin' in message) {
|
||||
m.pinInChatMessage = {}
|
||||
m.messageContextInfo = {}
|
||||
|
||||
Reference in New Issue
Block a user