mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Group fixes
This commit is contained in:
@@ -209,8 +209,9 @@ export default class WhatsAppWebBase extends WAConnection {
|
|||||||
groupMetadata = (jid: string) => this.queryExpecting200(['query', 'GroupMetadata', jid]) as Promise<WAGroupMetadata>
|
groupMetadata = (jid: string) => this.queryExpecting200(['query', 'GroupMetadata', jid]) as Promise<WAGroupMetadata>
|
||||||
/** Get the metadata (works after you've left the group also) */
|
/** Get the metadata (works after you've left the group also) */
|
||||||
groupCreatorAndParticipants = async (jid: string) => {
|
groupCreatorAndParticipants = async (jid: string) => {
|
||||||
const response = await this.queryExpecting200(['query', {type: 'group', jid: jid, epoch: '5'}, null], [WAMetric.group, WAFlag.ignore])
|
const query = ['query', {type: 'group', jid: jid, epoch: this.msgCount.toString()}, null]
|
||||||
const json = response[2]
|
const response = await this.queryExpecting200(query, [WAMetric.group, WAFlag.ignore])
|
||||||
|
const json = response[2][0]
|
||||||
return {
|
return {
|
||||||
id: jid,
|
id: jid,
|
||||||
owner: json[1].creator,
|
owner: json[1].creator,
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ WAClientTest('Groups', (client) => {
|
|||||||
await client.groupRemove(gid, [testJid])
|
await client.groupRemove(gid, [testJid])
|
||||||
})
|
})
|
||||||
it('should leave the group', async () => {
|
it('should leave the group', async () => {
|
||||||
await client.groupLeave(gid)
|
// await client.groupLeave(gid)
|
||||||
await client.groupCreatorAndParticipants (gid)
|
await client.groupCreatorAndParticipants ('919324993767-1593506879@g.us')
|
||||||
})
|
})
|
||||||
it('should archive the group', async () => {
|
it('should archive the group', async () => {
|
||||||
await client.archiveChat(gid)
|
await client.archiveChat(gid)
|
||||||
|
|||||||
Reference in New Issue
Block a user