- AcceptInvite: Join Guild using Code
This commit is contained in:
March 7th
2022-03-26 12:43:56 +07:00
parent f83e4f8a17
commit 9997e3db54
4 changed files with 145 additions and 7 deletions

View File

@@ -313,6 +313,19 @@ class Invite extends Base {
valueOf() {
return this.code;
}
/**
* Join this Guild using this invite.
* @returns {Promise<Invite>}
* @example
* await client.fetchInvite('code').then(async invite => {
* await invite.acceptInvite();
* });
*/
async acceptInvite() {
return await this.client.api.invite(this.code).post({ versioned: false });
}
}
/**