mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Group description fix
This commit is contained in:
@@ -212,13 +212,16 @@ export default class WhatsAppWebBase extends WAConnection {
|
||||
const query = ['query', {type: 'group', jid: jid, epoch: this.msgCount.toString()}, null]
|
||||
const response = await this.queryExpecting200(query, [WAMetric.group, WAFlag.ignore])
|
||||
const json = response[2][0]
|
||||
const participants = json[2] ? json[2].filter (item => item[0] === 'participant') : []
|
||||
const description = json[2] ? json[2].find (item => item[0] === 'description') : null
|
||||
return {
|
||||
id: jid,
|
||||
owner: json[1].creator,
|
||||
creator: json[1].creator,
|
||||
creation: parseInt(json[1].create),
|
||||
subject: null,
|
||||
participants: json[2] ? json[2].map (item => ({ id: item[1].jid, isAdmin: item[1].type==='admin' })) : []
|
||||
desc: description ? description[2].toString('utf-8') : null,
|
||||
participants: participants.map (item => ({ id: item[1].jid, isAdmin: item[1].type==='admin' }))
|
||||
} as WAGroupMetadata
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class WhatsAppWebMessages extends WhatsAppWebBase {
|
||||
|
||||
const info: MessageInfo = {reads: [], deliveries: []}
|
||||
if (response) {
|
||||
console.log (response)
|
||||
//console.log (response)
|
||||
const reads = response.filter (node => node[0] === 'read')
|
||||
if (reads[0]) {
|
||||
info.reads = reads[0][2].map (item => item[1])
|
||||
|
||||
@@ -50,6 +50,8 @@ export interface WAGroupMetadata {
|
||||
owner: string
|
||||
subject: string
|
||||
creation: number
|
||||
desc?: string
|
||||
descOwner?: string
|
||||
participants: [{ id: string; isAdmin: boolean; isSuperAdmin: boolean }]
|
||||
}
|
||||
export interface WAGroupModification {
|
||||
|
||||
Reference in New Issue
Block a user