mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
feat(Guild): add INVITES_DISABLED feature support (#9051)
* feat: disable invites * Update src/structures/Guild.js Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -233,6 +233,7 @@ class Guild extends AnonymousGuild {
|
||||
* * COMMUNITY
|
||||
* * DISCOVERABLE
|
||||
* * FEATURABLE
|
||||
* * INVITES_DISABLED
|
||||
* * INVITE_SPLASH
|
||||
* * MEMBER_VERIFICATION_GATE_ENABLED
|
||||
* * NEWS
|
||||
@@ -1317,6 +1318,17 @@ class Guild extends AnonymousGuild {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this guild's invites are disabled.
|
||||
* @param {boolean} [disabled=true] Whether the invites are disabled
|
||||
* @returns {Promise<Guild>}
|
||||
*/
|
||||
disableInvites(disabled = true) {
|
||||
const features = this.features.filter(feature => feature !== 'INVITES_DISABLED');
|
||||
if (disabled) features.push('INVITES_DISABLED');
|
||||
return this.edit({ features });
|
||||
}
|
||||
|
||||
/**
|
||||
* Leaves the guild.
|
||||
* @returns {Promise<Guild>}
|
||||
|
||||
Reference in New Issue
Block a user