feat: add INVITES_DISABLED guild feature

#9051 djs
This commit is contained in:
March 7th 2023-01-17 18:47:44 +07:00
parent 1ac8fd96ef
commit 597eb2979c
2 changed files with 11 additions and 0 deletions

View File

@ -1401,6 +1401,16 @@ class Guild extends AnonymousGuild {
}); });
return this; 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. * Leaves the guild.

1
typings/index.d.ts vendored
View File

@ -1374,6 +1374,7 @@ export class Guild extends AnonymousGuild {
public fetchWelcomeScreen(): Promise<WelcomeScreen>; public fetchWelcomeScreen(): Promise<WelcomeScreen>;
public fetchWidget(): Promise<Widget>; public fetchWidget(): Promise<Widget>;
public fetchWidgetSettings(): Promise<GuildWidgetSettings>; public fetchWidgetSettings(): Promise<GuildWidgetSettings>;
public disableInvites(disabled?: boolean): Promise<Guild>;
public leave(): Promise<Guild>; public leave(): Promise<Guild>;
public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise<Guild>; public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise<Guild>;
public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>; public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;