[+] Join groups by invite code
This commit is contained in:
parent
a6cc5e5bf2
commit
caa8598ec1
1 changed files with 23 additions and 0 deletions
|
|
@ -175,6 +175,19 @@ class Client extends EventEmitter {
|
|||
return ChatFactory.create(this, chat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts an invite by code
|
||||
* @param {string} inviteCode
|
||||
*/
|
||||
async acceptInvite(inviteCode) {
|
||||
const chat = await this.pupPage.evaluate(async inviteCode => {
|
||||
const chatId = await Store.Invite.sendJoinGroupViaInvite(inviteCode);
|
||||
return WWebJS.getChat(chatId._serialized);
|
||||
}, inviteCode);
|
||||
|
||||
return ChatFactory.create(this.client, chat);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Client;
|
||||
|
|
|
|||
Loading…
Reference in a new issue