diff --git a/src/managers/GuildManager.js b/src/managers/GuildManager.js index 770191654..43c9635da 100644 --- a/src/managers/GuildManager.js +++ b/src/managers/GuildManager.js @@ -140,7 +140,6 @@ class GuildManager extends BaseManager { * for the guild * @param {ExplicitContentFilterLevel} [options.explicitContentFilter] The explicit content filter level for the guild * @param {BufferResolvable|Base64Resolvable} [options.icon=null] The icon for the guild - * @param {string} [options.region] The region for the server, defaults to the closest one available * @param {PartialRoleData[]} [options.roles] The roles for this guild, * the first element of this array is used to change properties of the guild's everyone role. * @param {number} [options.systemChannelID] The ID of the system channel @@ -157,7 +156,6 @@ class GuildManager extends BaseManager { defaultMessageNotifications, explicitContentFilter, icon = null, - region, roles = [], systemChannelID, systemChannelFlags, @@ -195,7 +193,6 @@ class GuildManager extends BaseManager { .post({ data: { name, - region, icon, verification_level: verificationLevel, default_message_notifications: defaultMessageNotifications, diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 61bb48f09..31a951897 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -6,7 +6,6 @@ const GuildPreview = require('./GuildPreview'); const GuildTemplate = require('./GuildTemplate'); const Integration = require('./Integration'); const Invite = require('./Invite'); -const VoiceRegion = require('./VoiceRegion'); const Webhook = require('./Webhook'); const { Error, TypeError } = require('../errors'); const GuildApplicationCommandManager = require('../managers/GuildApplicationCommandManager'); @@ -141,12 +140,6 @@ class Guild extends BaseGuild { */ this.discoverySplash = data.discovery_splash; - /** - * The region the guild is located in - * @type {string} - */ - this.region = data.region; - /** * The full amount of members in this guild * @type {number} @@ -700,21 +693,6 @@ class Guild extends BaseGuild { }); } - /** - * Fetches available voice regions. - * @returns {Promise>} - */ - fetchVoiceRegions() { - return this.client.api - .guilds(this.id) - .regions.get() - .then(res => { - const regions = new Collection(); - for (const region of res) regions.set(region.id, new VoiceRegion(region)); - return regions; - }); - } - /** * Data for the Guild Widget object * @typedef {Object} GuildWidget @@ -818,7 +796,6 @@ class Guild extends BaseGuild { * The data for editing a guild. * @typedef {Object} GuildEditData * @property {string} [name] The name of the guild - * @property {string} [region] The region of the guild * @property {VerificationLevel|number} [verificationLevel] The verification level of the guild * @property {ExplicitContentFilterLevel|number} [explicitContentFilter] The level of the explicit content filter * @property {ChannelResolvable} [afkChannel] The AFK channel of the guild @@ -844,18 +821,16 @@ class Guild extends BaseGuild { * @param {string} [reason] Reason for editing this guild * @returns {Promise} * @example - * // Set the guild name and region + * // Set the guild name * guild.edit({ * name: 'Discord Guild', - * region: 'london', * }) - * .then(updated => console.log(`New guild name ${updated} in region ${updated.region}`)) + * .then(updated => console.log(`New guild name ${updated}`)) * .catch(console.error); */ edit(data, reason) { const _data = {}; if (data.name) _data.name = data.name; - if (data.region) _data.region = data.region; if (typeof data.verificationLevel !== 'undefined') { _data.verification_level = typeof data.verificationLevel === 'number' @@ -955,21 +930,6 @@ class Guild extends BaseGuild { return this.edit({ name }, reason); } - /** - * Edits the region of the guild. - * @param {string} region The new region of the guild - * @param {string} [reason] Reason for changing the guild's region - * @returns {Promise} - * @example - * // Edit the guild region - * guild.setRegion('london') - * .then(updated => console.log(`Updated guild region to ${updated.region}`)) - * .catch(console.error); - */ - setRegion(region, reason) { - return this.edit({ region }, reason); - } - /** * Edits the verification level of the guild. * @param {VerificationLevel|number} verificationLevel The new verification level of the guild @@ -1301,7 +1261,6 @@ class Guild extends BaseGuild { this.available === guild.available && this.splash === guild.splash && this.discoverySplash === guild.discoverySplash && - this.region === guild.region && this.name === guild.name && this.memberCount === guild.memberCount && this.large === guild.large && diff --git a/typings/index.d.ts b/typings/index.d.ts index d6c556324..f83c7f712 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -768,7 +768,6 @@ declare module 'discord.js' { public presences: PresenceManager; public readonly publicUpdatesChannel: TextChannel | null; public publicUpdatesChannelID: Snowflake | null; - public region: string; public roles: RoleManager; public readonly rulesChannel: TextChannel | null; public rulesChannelID: Snowflake | null; @@ -823,7 +822,6 @@ declare module 'discord.js' { public setOwner(owner: GuildMemberResolvable, reason?: string): Promise; public setPreferredLocale(preferredLocale: string, reason?: string): Promise; public setPublicUpdatesChannel(publicUpdatesChannel: ChannelResolvable | null, reason?: string): Promise; - public setRegion(region: string, reason?: string): Promise; public setRolePositions(rolePositions: readonly RolePosition[]): Promise; public setRulesChannel(rulesChannel: ChannelResolvable | null, reason?: string): Promise; public setSplash(splash: Base64Resolvable | null, reason?: string): Promise; @@ -2962,7 +2960,6 @@ declare module 'discord.js' { defaultMessageNotifications?: DefaultMessageNotifications | number; explicitContentFilter?: ExplicitContentFilterLevel | number; icon?: BufferResolvable | Base64Resolvable | null; - region?: string; roles?: PartialRoleData[]; systemChannelFlags?: SystemChannelFlagsResolvable; systemChannelID?: number; @@ -2976,7 +2973,6 @@ declare module 'discord.js' { interface GuildEditData { name?: string; - region?: string; verificationLevel?: VerificationLevel | number; explicitContentFilter?: ExplicitContentFilterLevel | number; defaultMessageNotifications?: DefaultMessageNotifications | number;