Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class Guild extends AnonymousGuild {
* * COMMUNITY
* * DISCOVERABLE
* * FEATURABLE
* * INVITES_DISABLED
* * INVITE_SPLASH
* * MEMBER_VERIFICATION_GATE_ENABLED
* * NEWS
Expand Down Expand Up @@ -1309,6 +1310,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>}
Expand Down
2 changes: 2 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ export class Guild extends AnonymousGuild {
public fetchWidget(): Promise<Widget>;
public fetchWidgetSettings(): Promise<GuildWidgetSettings>;
public leave(): Promise<Guild>;
public disableInvites(disabled?: boolean): Promise<Guild>;
public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise<Guild>;
public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;
public setBanner(banner: BufferResolvable | Base64Resolvable | null, reason?: string): Promise<Guild>;
Expand Down Expand Up @@ -5136,6 +5137,7 @@ export type GuildFeatures =
| 'COMMUNITY'
| 'DISCOVERABLE'
| 'FEATURABLE'
| 'INVITES_DISABLED'
| 'INVITE_SPLASH'
| 'MEMBER_VERIFICATION_GATE_ENABLED'
| 'NEWS'
Expand Down