diff --git a/packages/discord.js/src/errors/ErrorCodes.js b/packages/discord.js/src/errors/ErrorCodes.js index cb9a351c881b..cbdbfab4b385 100644 --- a/packages/discord.js/src/errors/ErrorCodes.js +++ b/packages/discord.js/src/errors/ErrorCodes.js @@ -59,7 +59,6 @@ * @property {'GuildVoiceChannelResolve'} GuildVoiceChannelResolve * @property {'GuildChannelOrphan'} GuildChannelOrphan * @property {'GuildChannelUnowned'} GuildChannelUnowned - * @property {'GuildOwned'} GuildOwned * @property {'GuildMembersTimeout'} GuildMembersTimeout * @property {'GuildSoundboardSoundsTimeout'} GuildSoundboardSoundsTimeout * @property {'GuildUncachedMe'} GuildUncachedMe @@ -195,7 +194,6 @@ const keys = [ 'GuildVoiceChannelResolve', 'GuildChannelOrphan', 'GuildChannelUnowned', - 'GuildOwned', 'GuildMembersTimeout', 'GuildSoundboardSoundsTimeout', 'GuildUncachedMe', diff --git a/packages/discord.js/src/errors/Messages.js b/packages/discord.js/src/errors/Messages.js index cec5a9ead212..177d52d84f65 100644 --- a/packages/discord.js/src/errors/Messages.js +++ b/packages/discord.js/src/errors/Messages.js @@ -64,7 +64,6 @@ const Messages = { [ErrorCodes.GuildVoiceChannelResolve]: 'Could not resolve channel to a guild voice channel.', [ErrorCodes.GuildChannelOrphan]: 'Could not find a parent to this guild channel.', [ErrorCodes.GuildChannelUnowned]: "The fetched channel does not belong to this manager's guild.", - [ErrorCodes.GuildOwned]: 'Guild is owned by the client.', [ErrorCodes.GuildMembersTimeout]: "Members didn't arrive in time.", [ErrorCodes.GuildSoundboardSoundsTimeout]: "Soundboard sounds didn't arrive in time.", [ErrorCodes.GuildUncachedMe]: 'The client user as a member of this guild is uncached.', diff --git a/packages/discord.js/src/structures/Guild.js b/packages/discord.js/src/structures/Guild.js index 589333bb5b14..72e03bb4a27b 100644 --- a/packages/discord.js/src/structures/Guild.js +++ b/packages/discord.js/src/structures/Guild.js @@ -1425,7 +1425,6 @@ class Guild extends AnonymousGuild { * .catch(console.error); */ async leave() { - if (this.ownerId === this.client.user.id) throw new DiscordjsError(ErrorCodes.GuildOwned); await this.client.rest.delete(Routes.userGuild(this.id)); return this; } diff --git a/packages/discord.js/src/structures/GuildChannel.js b/packages/discord.js/src/structures/GuildChannel.js index 8f42171b1c2d..6e30ee0b0034 100644 --- a/packages/discord.js/src/structures/GuildChannel.js +++ b/packages/discord.js/src/structures/GuildChannel.js @@ -462,7 +462,6 @@ class GuildChannel extends BaseChannel { * @readonly */ get manageable() { - if (this.client.user.id === this.guild.ownerId) return true; const permissions = this.permissionsFor(this.client.user); if (!permissions) return false; @@ -485,7 +484,6 @@ class GuildChannel extends BaseChannel { * @readonly */ get viewable() { - if (this.client.user.id === this.guild.ownerId) return true; const permissions = this.permissionsFor(this.client.user); if (!permissions) return false; return permissions.has(PermissionFlagsBits.ViewChannel, false); diff --git a/packages/discord.js/src/structures/GuildMember.js b/packages/discord.js/src/structures/GuildMember.js index 065cd06a599a..be68184d5330 100644 --- a/packages/discord.js/src/structures/GuildMember.js +++ b/packages/discord.js/src/structures/GuildMember.js @@ -357,7 +357,6 @@ class GuildMember extends Base { get manageable() { if (this.user.id === this.guild.ownerId) return false; if (this.user.id === this.client.user.id) return false; - if (this.client.user.id === this.guild.ownerId) return true; if (!this.guild.members.me) throw new DiscordjsError(ErrorCodes.GuildUncachedMe); return this.guild.members.me.roles.highest.comparePositionTo(this.roles.highest) > 0; } diff --git a/packages/discord.js/src/structures/ThreadChannel.js b/packages/discord.js/src/structures/ThreadChannel.js index 967a190b3528..95baddde0ffa 100644 --- a/packages/discord.js/src/structures/ThreadChannel.js +++ b/packages/discord.js/src/structures/ThreadChannel.js @@ -582,7 +582,6 @@ class ThreadChannel extends BaseChannel { * @readonly */ get viewable() { - if (this.client.user.id === this.guild.ownerId) return true; const permissions = this.permissionsFor(this.client.user); if (!permissions) return false; return permissions.has(PermissionFlagsBits.ViewChannel, false); diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 7d95a19e3e39..d687f05ee662 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -4038,7 +4038,6 @@ export enum DiscordjsErrorCodes { GuildVoiceChannelResolve = 'GuildVoiceChannelResolve', GuildChannelOrphan = 'GuildChannelOrphan', GuildChannelUnowned = 'GuildChannelUnowned', - GuildOwned = 'GuildOwned', GuildMembersTimeout = 'GuildMembersTimeout', GuildSoundboardSoundsTimeout = 'GuildSoundboardSoundsTimeout', GuildUncachedMe = 'GuildUncachedMe',