fix: disable autoVerify option

This commit is contained in:
March 7th 2022-12-18 13:18:19 +07:00
parent 42bcf8761f
commit e80e4f4843

View File

@ -320,14 +320,14 @@ class Invite extends Base {
/** /**
* Join this Guild using this invite. * Join this Guild using this invite.
* @param {boolean} autoVerify Whether to automatically verify member * @param {boolean} [autoVerify] Whether to automatically verify member
* @returns {Promise<Guild>} * @returns {Promise<Guild>}
* @example * @example
* await client.fetchInvite('code').then(async invite => { * await client.fetchInvite('code').then(async invite => {
* await invite.acceptInvite(); * await invite.acceptInvite();
* }); * });
*/ */
async acceptInvite(autoVerify = true) { async acceptInvite(autoVerify = false) {
if (!this.guild) throw new Error('INVITE_NO_GUILD'); if (!this.guild) throw new Error('INVITE_NO_GUILD');
if (this.client.guilds.cache.get(this.guild.id)) return this.guild; if (this.client.guilds.cache.get(this.guild.id)) return this.guild;
const dataHeader = { const dataHeader = {
@ -343,6 +343,10 @@ class Invite extends Base {
}, },
}); });
const guild = this.client.guilds.cache.get(this.guild.id); const guild = this.client.guilds.cache.get(this.guild.id);
if (autoVerify) {
console.warn('Feature is under maintenance - Invite#acceptInvite(true)');
}
/* Disabled
if (autoVerify) { if (autoVerify) {
const getForm = await this.client.api const getForm = await this.client.api
.guilds(this.guild.id) .guilds(this.guild.id)
@ -354,6 +358,7 @@ class Invite extends Base {
// https://discord.com/api/v9/guilds/:id/requests/@me // https://discord.com/api/v9/guilds/:id/requests/@me
await this.client.api.guilds(this.guild.id).requests['@me'].put({ data: { form_fields: [form] } }); await this.client.api.guilds(this.guild.id).requests['@me'].put({ data: { form_fields: [form] } });
} }
*/
return guild; return guild;
} }
} }