mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
feat(Guild): add premiumProgressbarEnabled (#6887)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -170,6 +170,14 @@ class Guild extends AnonymousGuild {
|
|||||||
this.large = Boolean(data.large);
|
this.large = Boolean(data.large);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('premium_progress_bar_enabled' in data) {
|
||||||
|
/**
|
||||||
|
* Whether this guild has its premium (boost) progress bar enabled
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
this.premiumProgressBarEnabled = data.premium_progress_bar_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of enabled guild features, here are the possible values:
|
* An array of enabled guild features, here are the possible values:
|
||||||
* * ANIMATED_ICON
|
* * ANIMATED_ICON
|
||||||
@@ -787,6 +795,7 @@ class Guild extends AnonymousGuild {
|
|||||||
* @property {TextChannelResolvable} [rulesChannel] The rules channel of the guild
|
* @property {TextChannelResolvable} [rulesChannel] The rules channel of the guild
|
||||||
* @property {TextChannelResolvable} [publicUpdatesChannel] The community updates channel of the guild
|
* @property {TextChannelResolvable} [publicUpdatesChannel] The community updates channel of the guild
|
||||||
* @property {string} [preferredLocale] The preferred locale of the guild
|
* @property {string} [preferredLocale] The preferred locale of the guild
|
||||||
|
* @property {boolean} [premiumProgressBarEnabled] Whether the guild's premium progress bar is enabled
|
||||||
* @property {string} [description] The discovery description of the guild
|
* @property {string} [description] The discovery description of the guild
|
||||||
* @property {Features[]} [features] The features of the guild
|
* @property {Features[]} [features] The features of the guild
|
||||||
*/
|
*/
|
||||||
@@ -869,6 +878,7 @@ class Guild extends AnonymousGuild {
|
|||||||
_data.description = data.description;
|
_data.description = data.description;
|
||||||
}
|
}
|
||||||
if (data.preferredLocale) _data.preferred_locale = data.preferredLocale;
|
if (data.preferredLocale) _data.preferred_locale = data.preferredLocale;
|
||||||
|
if ('premiumProgressBarEnabled' in data) _data.premium_progress_bar_enabled = data.premiumProgressBarEnabled;
|
||||||
const newData = await this.client.api.guilds(this.id).patch({ data: _data, reason });
|
const newData = await this.client.api.guilds(this.id).patch({ data: _data, reason });
|
||||||
return this.client.actions.GuildUpdate.handle(newData).updated;
|
return this.client.actions.GuildUpdate.handle(newData).updated;
|
||||||
}
|
}
|
||||||
@@ -1170,6 +1180,16 @@ class Guild extends AnonymousGuild {
|
|||||||
return this.edit({ preferredLocale }, reason);
|
return this.edit({ preferredLocale }, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edits the enabled state of the guild's premium progress bar
|
||||||
|
* @param {boolean} [enabled=true] The new enabled state of the guild's premium progress bar
|
||||||
|
* @param {string} [reason] Reason for changing the state of the guild's premium progress bar
|
||||||
|
* @returns {Promise<Guild>}
|
||||||
|
*/
|
||||||
|
setPremiumProgressBarEnabled(enabled = true, reason) {
|
||||||
|
return this.edit({ premiumProgressBarEnabled: enabled }, reason);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data that can be resolved to give a Category Channel object. This can be:
|
* Data that can be resolved to give a Category Channel object. This can be:
|
||||||
* * A CategoryChannel object
|
* * A CategoryChannel object
|
||||||
|
|||||||
3
typings/index.d.ts
vendored
3
typings/index.d.ts
vendored
@@ -862,6 +862,7 @@ export class Guild extends AnonymousGuild {
|
|||||||
public ownerId: Snowflake;
|
public ownerId: Snowflake;
|
||||||
public preferredLocale: string;
|
public preferredLocale: string;
|
||||||
public premiumSubscriptionCount: number | null;
|
public premiumSubscriptionCount: number | null;
|
||||||
|
public premiumProgressBarEnabled: boolean;
|
||||||
public premiumTier: PremiumTier;
|
public premiumTier: PremiumTier;
|
||||||
public presences: PresenceManager;
|
public presences: PresenceManager;
|
||||||
public readonly publicUpdatesChannel: TextChannel | null;
|
public readonly publicUpdatesChannel: TextChannel | null;
|
||||||
@@ -929,6 +930,7 @@ export class Guild extends AnonymousGuild {
|
|||||||
public setSystemChannel(systemChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
public setSystemChannel(systemChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
|
||||||
public setSystemChannelFlags(systemChannelFlags: SystemChannelFlagsResolvable, reason?: string): Promise<Guild>;
|
public setSystemChannelFlags(systemChannelFlags: SystemChannelFlagsResolvable, reason?: string): Promise<Guild>;
|
||||||
public setVerificationLevel(verificationLevel: VerificationLevel | number, reason?: string): Promise<Guild>;
|
public setVerificationLevel(verificationLevel: VerificationLevel | number, reason?: string): Promise<Guild>;
|
||||||
|
public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>;
|
||||||
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
||||||
public toJSON(): unknown;
|
public toJSON(): unknown;
|
||||||
}
|
}
|
||||||
@@ -4312,6 +4314,7 @@ export interface GuildEditData {
|
|||||||
rulesChannel?: TextChannelResolvable;
|
rulesChannel?: TextChannelResolvable;
|
||||||
publicUpdatesChannel?: TextChannelResolvable;
|
publicUpdatesChannel?: TextChannelResolvable;
|
||||||
preferredLocale?: string;
|
preferredLocale?: string;
|
||||||
|
premiumProgressBarEnabled?: boolean;
|
||||||
description?: string | null;
|
description?: string | null;
|
||||||
features?: GuildFeatures[];
|
features?: GuildFeatures[];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user