diff --git a/packages/discord.js/src/client/websocket/handlers/READY.js b/packages/discord.js/src/client/websocket/handlers/READY.js index 6c507d03e10a6..2eba493a024f8 100644 --- a/packages/discord.js/src/client/websocket/handlers/READY.js +++ b/packages/discord.js/src/client/websocket/handlers/READY.js @@ -7,7 +7,7 @@ module.exports = (client, { d: data }, shardId) => { if (client.user) { client.user._patch(data.user); } else { - ClientUser ??= require('../../../structures/ClientUser'); + ClientUser ??= require('../../../structures/ClientUser').ClientUser; client.user = new ClientUser(client, data.user); client.users.cache.set(client.user.id, client.user); } diff --git a/packages/discord.js/src/index.js b/packages/discord.js/src/index.js index 99935da5da017..2d0d6e358cdf8 100644 --- a/packages/discord.js/src/index.js +++ b/packages/discord.js/src/index.js @@ -38,7 +38,7 @@ exports.Options = require('./util/Options').Options; exports.Partials = require('./util/Partials').Partials; exports.PermissionsBitField = require('./util/PermissionsBitField').PermissionsBitField; exports.RoleFlagsBitField = require('./util/RoleFlagsBitField').RoleFlagsBitField; -exports.ShardEvents = require('./util/ShardEvents'); +exports.ShardEvents = require('./util/ShardEvents').ShardEvents; exports.SKUFlagsBitField = require('./util/SKUFlagsBitField').SKUFlagsBitField; exports.SnowflakeUtil = require('@sapphire/snowflake').DiscordSnowflake; exports.Status = require('./util/Status').Status; @@ -58,7 +58,7 @@ exports.ApplicationCommandPermissionsManager = require('./managers/ApplicationCommandPermissionsManager').ApplicationCommandPermissionsManager; exports.ApplicationEmojiManager = require('./managers/ApplicationEmojiManager').ApplicationEmojiManager; exports.AutoModerationRuleManager = require('./managers/AutoModerationRuleManager').AutoModerationRuleManager; -exports.BaseGuildEmojiManager = require('./managers/BaseGuildEmojiManager'); +exports.BaseGuildEmojiManager = require('./managers/BaseGuildEmojiManager').BaseGuildEmojiManager; exports.CachedManager = require('./managers/CachedManager').CachedManager; exports.ChannelManager = require('./managers/ChannelManager').ChannelManager; exports.ClientVoiceManager = require('./client/voice/ClientVoiceManager').ClientVoiceManager; diff --git a/packages/discord.js/src/structures/ActionRowBuilder.js b/packages/discord.js/src/structures/ActionRowBuilder.js index 720d261073913..c64a2084a59d4 100644 --- a/packages/discord.js/src/structures/ActionRowBuilder.js +++ b/packages/discord.js/src/structures/ActionRowBuilder.js @@ -2,8 +2,6 @@ const { ActionRowBuilder: BuildersActionRow } = require('@discordjs/builders'); const { isJSONEncodable } = require('@discordjs/util'); -const { createComponentBuilder } = require('../util/Components'); -const { toSnakeCase } = require('../util/Transformers'); /** * Represents an action row builder. @@ -29,6 +27,9 @@ class ActionRowBuilder extends BuildersActionRow { exports.ActionRowBuilder = ActionRowBuilder; +const { createComponentBuilder } = require('../util/Components'); +const { toSnakeCase } = require('../util/Transformers'); + /** * @external BuildersActionRow * @see {@link https://discord.js.org/docs/packages/builders/stable/ActionRowBuilder:Class} diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index f8af2ae663b10..86e1e8af9de58 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -15,7 +15,7 @@ const { Base } = require('./Base'); const { ClientApplication } = require('./ClientApplication'); const { Embed } = require('./Embed'); const { InteractionCollector } = require('./InteractionCollector'); -const { Mentions } = require('./MessageMentions'); +const { MessageMentions } = require('./MessageMentions'); const { MessagePayload } = require('./MessagePayload'); const { Poll } = require('./Poll.js'); const { ReactionCollector } = require('./ReactionCollector'); @@ -269,7 +269,7 @@ class Message extends Base { * All valid mentions that the message contains * @type {MessageMentions} */ - this.mentions = new Mentions( + this.mentions = new MessageMentions( this, data.mentions, data.mention_roles, @@ -278,7 +278,7 @@ class Message extends Base { data.referenced_message?.author, ); } else { - this.mentions = new Mentions( + this.mentions = new MessageMentions( this, data.mentions ?? this.mentions.users, data.mention_roles ?? this.mentions.roles, diff --git a/packages/discord.js/src/util/Channels.js b/packages/discord.js/src/util/Channels.js index 9c5310e5a21b5..ba83b3f13d3c9 100644 --- a/packages/discord.js/src/util/Channels.js +++ b/packages/discord.js/src/util/Channels.js @@ -3,17 +3,17 @@ const { lazy } = require('@discordjs/util'); const { ChannelType } = require('discord-api-types/v10'); -const getCategoryChannel = lazy(() => require('../structures/CategoryChannel')); -const getDMChannel = lazy(() => require('../structures/DMChannel')); -const getAnnouncementChannel = lazy(() => require('../structures/AnnouncementChannel')); -const getStageChannel = lazy(() => require('../structures/StageChannel')); -const getTextChannel = lazy(() => require('../structures/TextChannel')); -const getThreadChannel = lazy(() => require('../structures/ThreadChannel')); -const getVoiceChannel = lazy(() => require('../structures/VoiceChannel')); -const getDirectoryChannel = lazy(() => require('../structures/DirectoryChannel')); -const getPartialGroupDMChannel = lazy(() => require('../structures/PartialGroupDMChannel')); -const getForumChannel = lazy(() => require('../structures/ForumChannel')); -const getMediaChannel = lazy(() => require('../structures/MediaChannel')); +const getCategoryChannel = lazy(() => require('../structures/CategoryChannel').CategoryChannel); +const getDMChannel = lazy(() => require('../structures/DMChannel').DMChannel); +const getAnnouncementChannel = lazy(() => require('../structures/AnnouncementChannel').AnnouncementChannel); +const getStageChannel = lazy(() => require('../structures/StageChannel').StageChannel); +const getTextChannel = lazy(() => require('../structures/TextChannel').TextChannel); +const getThreadChannel = lazy(() => require('../structures/ThreadChannel').ThreadChannel); +const getVoiceChannel = lazy(() => require('../structures/VoiceChannel').VoiceChannel); +const getDirectoryChannel = lazy(() => require('../structures/DirectoryChannel').DirectoryChannel); +const getPartialGroupDMChannel = lazy(() => require('../structures/PartialGroupDMChannel').PartialGroupDMChannel); +const getForumChannel = lazy(() => require('../structures/ForumChannel').ForumChannel); +const getMediaChannel = lazy(() => require('../structures/MediaChannel').MediaChannel); /** * Extra options for creating a channel.