Group fixes

This commit is contained in:
Adhiraj
2020-07-12 14:13:33 +05:30
parent e8ec50488e
commit 7e9c9881d1
2 changed files with 5 additions and 4 deletions

View File

@@ -209,8 +209,9 @@ export default class WhatsAppWebBase extends WAConnection {
groupMetadata = (jid: string) => this.queryExpecting200(['query', 'GroupMetadata', jid]) as Promise<WAGroupMetadata>
/** Get the metadata (works after you've left the group also) */
groupCreatorAndParticipants = async (jid: string) => {
const response = await this.queryExpecting200(['query', {type: 'group', jid: jid, epoch: '5'}, null], [WAMetric.group, WAFlag.ignore])
const json = response[2]
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]
return {
id: jid,
owner: json[1].creator,

View File

@@ -171,8 +171,8 @@ WAClientTest('Groups', (client) => {
await client.groupRemove(gid, [testJid])
})
it('should leave the group', async () => {
await client.groupLeave(gid)
await client.groupCreatorAndParticipants (gid)
// await client.groupLeave(gid)
await client.groupCreatorAndParticipants ('919324993767-1593506879@g.us')
})
it('should archive the group', async () => {
await client.archiveChat(gid)