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:
Jaworek
2023-02-17 22:45:10 +01:00
committed by GitHub
parent a7dc40f1a8
commit 69d71e967e
2 changed files with 14 additions and 0 deletions

View File

@@ -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>}