diff --git a/src/structures/Guild.js b/src/structures/Guild.js index f56e149..dc55b5e 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -1401,6 +1401,16 @@ 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} + */ + 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. diff --git a/typings/index.d.ts b/typings/index.d.ts index 30168c6..4899d86 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1374,6 +1374,7 @@ export class Guild extends AnonymousGuild { public fetchWelcomeScreen(): Promise; public fetchWidget(): Promise; public fetchWidgetSettings(): Promise; + public disableInvites(disabled?: boolean): Promise; public leave(): Promise; public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise; public setAFKTimeout(afkTimeout: number, reason?: string): Promise;