diff --git a/packages/discord.js/scripts/generateRequires.mjs b/packages/discord.js/scripts/generateRequires.mjs index b6e28db8a2f60..893cc9f558307 100644 --- a/packages/discord.js/scripts/generateRequires.mjs +++ b/packages/discord.js/scripts/generateRequires.mjs @@ -1,17 +1,17 @@ import { readdir, writeFile } from 'node:fs/promises'; async function writeWebsocketHandlerImports() { - const lines = ["'use strict';\n", 'const handlers = Object.fromEntries([']; + const lines = ["'use strict';\n", 'const PacketHandlers = Object.fromEntries([']; const handlersDirectory = new URL('../src/client/websocket/handlers', import.meta.url); - for (const file of await (await readdir(handlersDirectory)).sort()) { + for (const file of (await readdir(handlersDirectory)).sort()) { if (file === 'index.js') continue; lines.push(` ['${file.slice(0, -3)}', require('./${file.slice(0, -3)}')],`); } - lines.push(']);\n\nmodule.exports = handlers;\n'); + lines.push(']);\n\nexports.PacketHandlers = PacketHandlers;\n'); const outputFile = new URL('../src/client/websocket/handlers/index.js', import.meta.url); @@ -44,7 +44,7 @@ async function writeClientActionImports() { lines.push(" this[Action.name.replace(/Action$/, '')] = new Action(this.client);"); lines.push(' }'); lines.push('}\n'); - lines.push('module.exports = ActionsManager;\n'); + lines.push('exports.ActionsManager = ActionsManager;\n'); const outputFile = new URL('../src/client/actions/ActionsManager.js', import.meta.url); diff --git a/packages/discord.js/src/client/BaseClient.js b/packages/discord.js/src/client/BaseClient.js index 3f26270da9fcf..70397d9a073f0 100644 --- a/packages/discord.js/src/client/BaseClient.js +++ b/packages/discord.js/src/client/BaseClient.js @@ -4,7 +4,7 @@ const EventEmitter = require('node:events'); const { REST } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v10'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const Options = require('../util/Options'); +const { Options } = require('../util/Options'); const { flatten } = require('../util/Util'); /** @@ -112,7 +112,7 @@ class BaseClient extends EventEmitter { } } -module.exports = BaseClient; +exports.BaseClient = BaseClient; /** * @external REST diff --git a/packages/discord.js/src/client/Client.js b/packages/discord.js/src/client/Client.js index 9db2739c3ce39..a454b29066734 100644 --- a/packages/discord.js/src/client/Client.js +++ b/packages/discord.js/src/client/Client.js @@ -6,32 +6,32 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { WebSocketManager, WebSocketShardEvents, WebSocketShardStatus } = require('@discordjs/ws'); const { GatewayDispatchEvents, GatewayIntentBits, OAuth2Scopes, Routes } = require('discord-api-types/v10'); -const BaseClient = require('./BaseClient'); -const ActionsManager = require('./actions/ActionsManager'); -const ClientVoiceManager = require('./voice/ClientVoiceManager'); -const PacketHandlers = require('./websocket/handlers'); +const { BaseClient } = require('./BaseClient'); +const { ActionsManager } = require('./actions/ActionsManager'); +const { ClientVoiceManager } = require('./voice/ClientVoiceManager'); +const { PacketHandlers } = require('./websocket/handlers'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); -const BaseGuildEmojiManager = require('../managers/BaseGuildEmojiManager'); -const ChannelManager = require('../managers/ChannelManager'); -const GuildManager = require('../managers/GuildManager'); -const UserManager = require('../managers/UserManager'); -const ShardClientUtil = require('../sharding/ShardClientUtil'); -const ClientPresence = require('../structures/ClientPresence'); -const GuildPreview = require('../structures/GuildPreview'); -const GuildTemplate = require('../structures/GuildTemplate'); -const Invite = require('../structures/Invite'); +const { BaseGuildEmojiManager } = require('../managers/BaseGuildEmojiManager'); +const { ChannelManager } = require('../managers/ChannelManager'); +const { GuildManager } = require('../managers/GuildManager'); +const { UserManager } = require('../managers/UserManager'); +const { ShardClientUtil } = require('../sharding/ShardClientUtil'); +const { ClientPresence } = require('../structures/ClientPresence'); +const { GuildPreview } = require('../structures/GuildPreview'); +const { GuildTemplate } = require('../structures/GuildTemplate'); +const { Invite } = require('../structures/Invite'); const { Sticker } = require('../structures/Sticker'); -const StickerPack = require('../structures/StickerPack'); -const VoiceRegion = require('../structures/VoiceRegion'); -const Webhook = require('../structures/Webhook'); -const Widget = require('../structures/Widget'); +const { StickerPack } = require('../structures/StickerPack'); +const { VoiceRegion } = require('../structures/VoiceRegion'); +const { Webhook } = require('../structures/Webhook'); +const { Widget } = require('../structures/Widget'); const { resolveInviteCode, resolveGuildTemplateCode } = require('../util/DataResolver'); -const Events = require('../util/Events'); -const IntentsBitField = require('../util/IntentsBitField'); -const Options = require('../util/Options'); -const PermissionsBitField = require('../util/PermissionsBitField'); -const Status = require('../util/Status'); -const Sweepers = require('../util/Sweepers'); +const { Events } = require('../util/Events'); +const { IntentsBitField } = require('../util/IntentsBitField'); +const { Options } = require('../util/Options'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); +const { Status } = require('../util/Status'); +const { Sweepers } = require('../util/Sweepers'); const WaitingForGuildEvents = [GatewayDispatchEvents.GuildCreate, GatewayDispatchEvents.GuildDelete]; const BeforeReadyWhitelist = [ @@ -732,7 +732,7 @@ class Client extends BaseClient { } } -module.exports = Client; +exports.Client = Client; /** * @class SnowflakeUtil diff --git a/packages/discord.js/src/client/WebhookClient.js b/packages/discord.js/src/client/WebhookClient.js index 5bb6412674f57..82d30c62b16d4 100644 --- a/packages/discord.js/src/client/WebhookClient.js +++ b/packages/discord.js/src/client/WebhookClient.js @@ -1,8 +1,8 @@ 'use strict'; -const BaseClient = require('./BaseClient'); +const { BaseClient } = require('./BaseClient'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const Webhook = require('../structures/Webhook'); +const { Webhook } = require('../structures/Webhook'); const { parseWebhookURL } = require('../util/Util'); /** @@ -100,4 +100,4 @@ class WebhookClient extends BaseClient { Webhook.applyToClass(WebhookClient); -module.exports = WebhookClient; +exports.WebhookClient = WebhookClient; diff --git a/packages/discord.js/src/client/actions/Action.js b/packages/discord.js/src/client/actions/Action.js index b5f1f756b4a2a..06bd68de892e8 100644 --- a/packages/discord.js/src/client/actions/Action.js +++ b/packages/discord.js/src/client/actions/Action.js @@ -1,6 +1,6 @@ 'use strict'; -const Partials = require('../../util/Partials'); +const { Partials } = require('../../util/Partials'); /* @@ -14,7 +14,7 @@ that WebSocket events don't clash with REST methods. */ -class GenericAction { +class Action { constructor(client) { this.client = client; } @@ -117,4 +117,4 @@ class GenericAction { } } -module.exports = GenericAction; +exports.Action = Action; diff --git a/packages/discord.js/src/client/actions/ActionsManager.js b/packages/discord.js/src/client/actions/ActionsManager.js index dd305a94804a4..f1f3b876b96b8 100644 --- a/packages/discord.js/src/client/actions/ActionsManager.js +++ b/packages/discord.js/src/client/actions/ActionsManager.js @@ -11,69 +11,69 @@ class ActionsManager { constructor(client) { this.client = client; - this.register(require('./ApplicationCommandPermissionsUpdate')); - this.register(require('./AutoModerationActionExecution')); - this.register(require('./AutoModerationRuleCreate')); - this.register(require('./AutoModerationRuleDelete')); - this.register(require('./AutoModerationRuleUpdate')); - this.register(require('./ChannelCreate')); - this.register(require('./ChannelDelete')); - this.register(require('./ChannelUpdate')); - this.register(require('./EntitlementCreate')); - this.register(require('./EntitlementDelete')); - this.register(require('./EntitlementUpdate')); - this.register(require('./GuildAuditLogEntryCreate')); - this.register(require('./GuildBanAdd')); - this.register(require('./GuildBanRemove')); - this.register(require('./GuildChannelsPositionUpdate')); - this.register(require('./GuildDelete')); - this.register(require('./GuildEmojiCreate')); - this.register(require('./GuildEmojiDelete')); - this.register(require('./GuildEmojiUpdate')); - this.register(require('./GuildEmojisUpdate')); - this.register(require('./GuildIntegrationsUpdate')); - this.register(require('./GuildMemberRemove')); - this.register(require('./GuildMemberUpdate')); - this.register(require('./GuildRoleCreate')); - this.register(require('./GuildRoleDelete')); - this.register(require('./GuildRoleUpdate')); - this.register(require('./GuildRolesPositionUpdate')); - this.register(require('./GuildScheduledEventCreate')); - this.register(require('./GuildScheduledEventDelete')); - this.register(require('./GuildScheduledEventUpdate')); - this.register(require('./GuildScheduledEventUserAdd')); - this.register(require('./GuildScheduledEventUserRemove')); - this.register(require('./GuildStickerCreate')); - this.register(require('./GuildStickerDelete')); - this.register(require('./GuildStickerUpdate')); - this.register(require('./GuildStickersUpdate')); - this.register(require('./GuildUpdate')); - this.register(require('./InteractionCreate')); - this.register(require('./InviteCreate')); - this.register(require('./InviteDelete')); - this.register(require('./MessageCreate')); - this.register(require('./MessageDelete')); - this.register(require('./MessageDeleteBulk')); - this.register(require('./MessagePollVoteAdd')); - this.register(require('./MessagePollVoteRemove')); - this.register(require('./MessageReactionAdd')); - this.register(require('./MessageReactionRemove')); - this.register(require('./MessageReactionRemoveAll')); - this.register(require('./MessageReactionRemoveEmoji')); - this.register(require('./MessageUpdate')); - this.register(require('./PresenceUpdate')); - this.register(require('./StageInstanceCreate')); - this.register(require('./StageInstanceDelete')); - this.register(require('./StageInstanceUpdate')); - this.register(require('./ThreadCreate')); - this.register(require('./ThreadDelete')); - this.register(require('./ThreadListSync')); - this.register(require('./ThreadMemberUpdate')); - this.register(require('./ThreadMembersUpdate')); - this.register(require('./TypingStart')); - this.register(require('./UserUpdate')); - this.register(require('./VoiceStateUpdate')); - this.register(require('./WebhooksUpdate')); + this.register(require('./ApplicationCommandPermissionsUpdate').ApplicationCommandPermissionsUpdateAction); + this.register(require('./AutoModerationActionExecution').AutoModerationActionExecutionAction); + this.register(require('./AutoModerationRuleCreate').AutoModerationRuleCreateAction); + this.register(require('./AutoModerationRuleDelete').AutoModerationRuleDeleteAction); + this.register(require('./AutoModerationRuleUpdate').AutoModerationRuleUpdateAction); + this.register(require('./ChannelCreate').ChannelCreateAction); + this.register(require('./ChannelDelete').ChannelDeleteAction); + this.register(require('./ChannelUpdate').ChannelUpdateAction); + this.register(require('./EntitlementCreate').EntitlementCreateAction); + this.register(require('./EntitlementDelete').EntitlementDeleteAction); + this.register(require('./EntitlementUpdate').EntitlementUpdateAction); + this.register(require('./GuildAuditLogEntryCreate').GuildAuditLogEntryCreateAction); + this.register(require('./GuildBanAdd').GuildBanAddAction); + this.register(require('./GuildBanRemove').GuildBanRemoveAction); + this.register(require('./GuildChannelsPositionUpdate').GuildChannelsPositionUpdateAction); + this.register(require('./GuildDelete').GuildDeleteAction); + this.register(require('./GuildEmojiCreate').GuildEmojiCreateAction); + this.register(require('./GuildEmojiDelete').GuildEmojiDeleteAction); + this.register(require('./GuildEmojisUpdate').GuildEmojisUpdateAction); + this.register(require('./GuildEmojiUpdate').GuildEmojiUpdateAction); + this.register(require('./GuildIntegrationsUpdate').GuildIntegrationsUpdateAction); + this.register(require('./GuildMemberRemove').GuildMemberRemoveAction); + this.register(require('./GuildMemberUpdate').GuildMemberUpdateAction); + this.register(require('./GuildRoleCreate').GuildRoleCreateAction); + this.register(require('./GuildRoleDelete').GuildRoleDeleteAction); + this.register(require('./GuildRolesPositionUpdate').GuildRolesPositionUpdateAction); + this.register(require('./GuildRoleUpdate').GuildRoleUpdateAction); + this.register(require('./GuildScheduledEventCreate').GuildScheduledEventCreateAction); + this.register(require('./GuildScheduledEventDelete').GuildScheduledEventDeleteAction); + this.register(require('./GuildScheduledEventUpdate').GuildScheduledEventUpdateAction); + this.register(require('./GuildScheduledEventUserAdd').GuildScheduledEventUserAddAction); + this.register(require('./GuildScheduledEventUserRemove').GuildScheduledEventUserRemoveAction); + this.register(require('./GuildStickerCreate').GuildStickerCreateAction); + this.register(require('./GuildStickerDelete').GuildStickerDeleteAction); + this.register(require('./GuildStickersUpdate').GuildStickersUpdateAction); + this.register(require('./GuildStickerUpdate').GuildStickerUpdateAction); + this.register(require('./GuildUpdate').GuildUpdateAction); + this.register(require('./InteractionCreate').InteractionCreateAction); + this.register(require('./InviteCreate').InviteCreateAction); + this.register(require('./InviteDelete').InviteDeleteAction); + this.register(require('./MessageCreate').MessageCreateAction); + this.register(require('./MessageDelete').MessageDeleteAction); + this.register(require('./MessageDeleteBulk').MessageDeleteBulkAction); + this.register(require('./MessagePollVoteAdd').MessagePollVoteAddAction); + this.register(require('./MessagePollVoteRemove').MessagePollVoteRemoveAction); + this.register(require('./MessageReactionAdd').MessageReactionAddAction); + this.register(require('./MessageReactionRemove').MessageReactionRemoveAction); + this.register(require('./MessageReactionRemoveAll').MessageReactionRemoveAllAction); + this.register(require('./MessageReactionRemoveEmoji').MessageReactionRemoveEmojiAction); + this.register(require('./MessageUpdate').MessageUpdateAction); + this.register(require('./PresenceUpdate').PresenceUpdateAction); + this.register(require('./StageInstanceCreate').StageInstanceCreateAction); + this.register(require('./StageInstanceDelete').StageInstanceDeleteAction); + this.register(require('./StageInstanceUpdate').StageInstanceUpdateAction); + this.register(require('./ThreadCreate').ThreadCreateAction); + this.register(require('./ThreadDelete').ThreadDeleteAction); + this.register(require('./ThreadListSync').ThreadListSyncAction); + this.register(require('./ThreadMembersUpdate').ThreadMembersUpdateAction); + this.register(require('./ThreadMemberUpdate').ThreadMemberUpdateAction); + this.register(require('./TypingStart').TypingStartAction); + this.register(require('./UserUpdate').UserUpdateAction); + this.register(require('./VoiceStateUpdate').VoiceStateUpdateAction); + this.register(require('./WebhooksUpdate').WebhooksUpdateAction); } register(Action) { @@ -81,4 +81,4 @@ class ActionsManager { } } -module.exports = ActionsManager; +exports.ActionsManager = ActionsManager; diff --git a/packages/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js b/packages/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js index f2bc214d28a11..9d5efe6b8d72a 100644 --- a/packages/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js +++ b/packages/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); /** * The data received in the {@link Client#event:applicationCommandPermissionsUpdate} event @@ -31,4 +31,4 @@ class ApplicationCommandPermissionsUpdateAction extends Action { } } -module.exports = ApplicationCommandPermissionsUpdateAction; +exports.ApplicationCommandPermissionsUpdateAction = ApplicationCommandPermissionsUpdateAction; diff --git a/packages/discord.js/src/client/actions/AutoModerationActionExecution.js b/packages/discord.js/src/client/actions/AutoModerationActionExecution.js index ad601167c41fd..c0147c70835df 100644 --- a/packages/discord.js/src/client/actions/AutoModerationActionExecution.js +++ b/packages/discord.js/src/client/actions/AutoModerationActionExecution.js @@ -1,8 +1,8 @@ 'use strict'; -const Action = require('./Action'); -const AutoModerationActionExecution = require('../../structures/AutoModerationActionExecution'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { AutoModerationActionExecution } = require('../../structures/AutoModerationActionExecution'); +const { Events } = require('../../util/Events'); class AutoModerationActionExecutionAction extends Action { handle(data) { @@ -23,4 +23,4 @@ class AutoModerationActionExecutionAction extends Action { } } -module.exports = AutoModerationActionExecutionAction; +exports.AutoModerationActionExecutionAction = AutoModerationActionExecutionAction; diff --git a/packages/discord.js/src/client/actions/AutoModerationRuleCreate.js b/packages/discord.js/src/client/actions/AutoModerationRuleCreate.js index 775b1d370cf52..d261b1233c0eb 100644 --- a/packages/discord.js/src/client/actions/AutoModerationRuleCreate.js +++ b/packages/discord.js/src/client/actions/AutoModerationRuleCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class AutoModerationRuleCreateAction extends Action { handle(data) { @@ -24,4 +24,4 @@ class AutoModerationRuleCreateAction extends Action { } } -module.exports = AutoModerationRuleCreateAction; +exports.AutoModerationRuleCreateAction = AutoModerationRuleCreateAction; diff --git a/packages/discord.js/src/client/actions/AutoModerationRuleDelete.js b/packages/discord.js/src/client/actions/AutoModerationRuleDelete.js index 641822c24b2ab..7064477f7d219 100644 --- a/packages/discord.js/src/client/actions/AutoModerationRuleDelete.js +++ b/packages/discord.js/src/client/actions/AutoModerationRuleDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class AutoModerationRuleDeleteAction extends Action { handle(data) { @@ -28,4 +28,4 @@ class AutoModerationRuleDeleteAction extends Action { } } -module.exports = AutoModerationRuleDeleteAction; +exports.AutoModerationRuleDeleteAction = AutoModerationRuleDeleteAction; diff --git a/packages/discord.js/src/client/actions/AutoModerationRuleUpdate.js b/packages/discord.js/src/client/actions/AutoModerationRuleUpdate.js index 56e39568c5c73..f5741b2a4508a 100644 --- a/packages/discord.js/src/client/actions/AutoModerationRuleUpdate.js +++ b/packages/discord.js/src/client/actions/AutoModerationRuleUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class AutoModerationRuleUpdateAction extends Action { handle(data) { @@ -26,4 +26,4 @@ class AutoModerationRuleUpdateAction extends Action { } } -module.exports = AutoModerationRuleUpdateAction; +exports.AutoModerationRuleUpdateAction = AutoModerationRuleUpdateAction; diff --git a/packages/discord.js/src/client/actions/ChannelCreate.js b/packages/discord.js/src/client/actions/ChannelCreate.js index fdf8dddd44f17..f25ada2f0255c 100644 --- a/packages/discord.js/src/client/actions/ChannelCreate.js +++ b/packages/discord.js/src/client/actions/ChannelCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ChannelCreateAction extends Action { handle(data) { @@ -20,4 +20,4 @@ class ChannelCreateAction extends Action { } } -module.exports = ChannelCreateAction; +exports.ChannelCreateAction = ChannelCreateAction; diff --git a/packages/discord.js/src/client/actions/ChannelDelete.js b/packages/discord.js/src/client/actions/ChannelDelete.js index acf03d90527c6..a5eb4f29bd05a 100644 --- a/packages/discord.js/src/client/actions/ChannelDelete.js +++ b/packages/discord.js/src/client/actions/ChannelDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ChannelDeleteAction extends Action { handle(data) { @@ -20,4 +20,4 @@ class ChannelDeleteAction extends Action { } } -module.exports = ChannelDeleteAction; +exports.ChannelDeleteAction = ChannelDeleteAction; diff --git a/packages/discord.js/src/client/actions/ChannelUpdate.js b/packages/discord.js/src/client/actions/ChannelUpdate.js index 7ca331aacae93..473e110511c22 100644 --- a/packages/discord.js/src/client/actions/ChannelUpdate.js +++ b/packages/discord.js/src/client/actions/ChannelUpdate.js @@ -1,6 +1,6 @@ 'use strict'; -const Action = require('./Action'); +const { Action } = require('./Action'); const { createChannel } = require('../../util/Channels'); class ChannelUpdateAction extends Action { @@ -39,4 +39,4 @@ class ChannelUpdateAction extends Action { } } -module.exports = ChannelUpdateAction; +exports.ChannelUpdateAction = ChannelUpdateAction; diff --git a/packages/discord.js/src/client/actions/EntitlementCreate.js b/packages/discord.js/src/client/actions/EntitlementCreate.js index 63082af25bc4a..5fd142421f657 100644 --- a/packages/discord.js/src/client/actions/EntitlementCreate.js +++ b/packages/discord.js/src/client/actions/EntitlementCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class EntitlementCreateAction extends Action { handle(data) { @@ -20,4 +20,4 @@ class EntitlementCreateAction extends Action { } } -module.exports = EntitlementCreateAction; +exports.EntitlementCreateAction = EntitlementCreateAction; diff --git a/packages/discord.js/src/client/actions/EntitlementDelete.js b/packages/discord.js/src/client/actions/EntitlementDelete.js index 7a397548fc0a2..1a7bd78ee335b 100644 --- a/packages/discord.js/src/client/actions/EntitlementDelete.js +++ b/packages/discord.js/src/client/actions/EntitlementDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class EntitlementDeleteAction extends Action { handle(data) { @@ -24,4 +24,4 @@ class EntitlementDeleteAction extends Action { } } -module.exports = EntitlementDeleteAction; +exports.EntitlementDeleteAction = EntitlementDeleteAction; diff --git a/packages/discord.js/src/client/actions/EntitlementUpdate.js b/packages/discord.js/src/client/actions/EntitlementUpdate.js index 10a61dbc05f7d..bd379731ccac6 100644 --- a/packages/discord.js/src/client/actions/EntitlementUpdate.js +++ b/packages/discord.js/src/client/actions/EntitlementUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class EntitlementUpdateAction extends Action { handle(data) { @@ -22,4 +22,4 @@ class EntitlementUpdateAction extends Action { } } -module.exports = EntitlementUpdateAction; +exports.EntitlementUpdateAction = EntitlementUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildAuditLogEntryCreate.js b/packages/discord.js/src/client/actions/GuildAuditLogEntryCreate.js index fa16de60b88eb..e723c142bbd22 100644 --- a/packages/discord.js/src/client/actions/GuildAuditLogEntryCreate.js +++ b/packages/discord.js/src/client/actions/GuildAuditLogEntryCreate.js @@ -1,8 +1,8 @@ 'use strict'; -const Action = require('./Action'); -const GuildAuditLogsEntry = require('../../structures/GuildAuditLogsEntry'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { GuildAuditLogsEntry } = require('../../structures/GuildAuditLogsEntry'); +const { Events } = require('../../util/Events'); class GuildAuditLogEntryCreateAction extends Action { handle(data) { @@ -26,4 +26,4 @@ class GuildAuditLogEntryCreateAction extends Action { } } -module.exports = GuildAuditLogEntryCreateAction; +exports.GuildAuditLogEntryCreateAction = GuildAuditLogEntryCreateAction; diff --git a/packages/discord.js/src/client/actions/GuildBanAdd.js b/packages/discord.js/src/client/actions/GuildBanAdd.js index 2ef4b11ac6308..31f8a72601fce 100644 --- a/packages/discord.js/src/client/actions/GuildBanAdd.js +++ b/packages/discord.js/src/client/actions/GuildBanAdd.js @@ -1,9 +1,9 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); -class GuildBanAdd extends Action { +class GuildBanAddAction extends Action { handle(data) { const client = this.client; const guild = client.guilds.cache.get(data.guild_id); @@ -17,4 +17,4 @@ class GuildBanAdd extends Action { } } -module.exports = GuildBanAdd; +exports.GuildBanAddAction = GuildBanAddAction; diff --git a/packages/discord.js/src/client/actions/GuildBanRemove.js b/packages/discord.js/src/client/actions/GuildBanRemove.js index 8048efd8ed9c5..ccd19922fa897 100644 --- a/packages/discord.js/src/client/actions/GuildBanRemove.js +++ b/packages/discord.js/src/client/actions/GuildBanRemove.js @@ -1,10 +1,10 @@ 'use strict'; -const Action = require('./Action'); -const GuildBan = require('../../structures/GuildBan'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { GuildBan } = require('../../structures/GuildBan'); +const { Events } = require('../../util/Events'); -class GuildBanRemove extends Action { +class GuildBanRemoveAction extends Action { handle(data) { const client = this.client; const guild = client.guilds.cache.get(data.guild_id); @@ -22,4 +22,4 @@ class GuildBanRemove extends Action { } } -module.exports = GuildBanRemove; +exports.GuildBanRemoveAction = GuildBanRemoveAction; diff --git a/packages/discord.js/src/client/actions/GuildChannelsPositionUpdate.js b/packages/discord.js/src/client/actions/GuildChannelsPositionUpdate.js index a393167e6ec09..3fff19d04fe03 100644 --- a/packages/discord.js/src/client/actions/GuildChannelsPositionUpdate.js +++ b/packages/discord.js/src/client/actions/GuildChannelsPositionUpdate.js @@ -1,8 +1,8 @@ 'use strict'; -const Action = require('./Action'); +const { Action } = require('./Action'); -class GuildChannelsPositionUpdate extends Action { +class GuildChannelsPositionUpdateAction extends Action { handle(data) { const client = this.client; @@ -18,4 +18,4 @@ class GuildChannelsPositionUpdate extends Action { } } -module.exports = GuildChannelsPositionUpdate; +exports.GuildChannelsPositionUpdateAction = GuildChannelsPositionUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildDelete.js b/packages/discord.js/src/client/actions/GuildDelete.js index eb0a44d1e592f..b8258d9d20d42 100644 --- a/packages/discord.js/src/client/actions/GuildDelete.js +++ b/packages/discord.js/src/client/actions/GuildDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildDeleteAction extends Action { handle(data) { @@ -41,4 +41,4 @@ class GuildDeleteAction extends Action { } } -module.exports = GuildDeleteAction; +exports.GuildDeleteAction = GuildDeleteAction; diff --git a/packages/discord.js/src/client/actions/GuildEmojiCreate.js b/packages/discord.js/src/client/actions/GuildEmojiCreate.js index 61858cf573c88..00b3f046b7566 100644 --- a/packages/discord.js/src/client/actions/GuildEmojiCreate.js +++ b/packages/discord.js/src/client/actions/GuildEmojiCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildEmojiCreateAction extends Action { handle(guild, createdEmoji) { @@ -17,4 +17,4 @@ class GuildEmojiCreateAction extends Action { } } -module.exports = GuildEmojiCreateAction; +exports.GuildEmojiCreateAction = GuildEmojiCreateAction; diff --git a/packages/discord.js/src/client/actions/GuildEmojiDelete.js b/packages/discord.js/src/client/actions/GuildEmojiDelete.js index e3373c2e8c181..dd491a4a99af0 100644 --- a/packages/discord.js/src/client/actions/GuildEmojiDelete.js +++ b/packages/discord.js/src/client/actions/GuildEmojiDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildEmojiDeleteAction extends Action { handle(emoji) { @@ -16,4 +16,4 @@ class GuildEmojiDeleteAction extends Action { } } -module.exports = GuildEmojiDeleteAction; +exports.GuildEmojiDeleteAction = GuildEmojiDeleteAction; diff --git a/packages/discord.js/src/client/actions/GuildEmojiUpdate.js b/packages/discord.js/src/client/actions/GuildEmojiUpdate.js index 6bf96579e81fc..9054b916d9729 100644 --- a/packages/discord.js/src/client/actions/GuildEmojiUpdate.js +++ b/packages/discord.js/src/client/actions/GuildEmojiUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildEmojiUpdateAction extends Action { handle(current, data) { @@ -17,4 +17,4 @@ class GuildEmojiUpdateAction extends Action { } } -module.exports = GuildEmojiUpdateAction; +exports.GuildEmojiUpdateAction = GuildEmojiUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildEmojisUpdate.js b/packages/discord.js/src/client/actions/GuildEmojisUpdate.js index 7829db1f5096c..b151b707121dd 100644 --- a/packages/discord.js/src/client/actions/GuildEmojisUpdate.js +++ b/packages/discord.js/src/client/actions/GuildEmojisUpdate.js @@ -1,6 +1,6 @@ 'use strict'; -const Action = require('./Action'); +const { Action } = require('./Action'); class GuildEmojisUpdateAction extends Action { handle(data) { @@ -31,4 +31,4 @@ class GuildEmojisUpdateAction extends Action { } } -module.exports = GuildEmojisUpdateAction; +exports.GuildEmojisUpdateAction = GuildEmojisUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildIntegrationsUpdate.js b/packages/discord.js/src/client/actions/GuildIntegrationsUpdate.js index 28b9bbb15f3df..4f7ede4781638 100644 --- a/packages/discord.js/src/client/actions/GuildIntegrationsUpdate.js +++ b/packages/discord.js/src/client/actions/GuildIntegrationsUpdate.js @@ -1,9 +1,9 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); -class GuildIntegrationsUpdate extends Action { +class GuildIntegrationsUpdateAction extends Action { handle(data) { const client = this.client; const guild = client.guilds.cache.get(data.guild_id); @@ -16,4 +16,4 @@ class GuildIntegrationsUpdate extends Action { } } -module.exports = GuildIntegrationsUpdate; +exports.GuildIntegrationsUpdateAction = GuildIntegrationsUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildMemberRemove.js b/packages/discord.js/src/client/actions/GuildMemberRemove.js index e7cefee67a11b..247bfe9d55303 100644 --- a/packages/discord.js/src/client/actions/GuildMemberRemove.js +++ b/packages/discord.js/src/client/actions/GuildMemberRemove.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildMemberRemoveAction extends Action { handle(data) { @@ -27,4 +27,4 @@ class GuildMemberRemoveAction extends Action { } } -module.exports = GuildMemberRemoveAction; +exports.GuildMemberRemoveAction = GuildMemberRemoveAction; diff --git a/packages/discord.js/src/client/actions/GuildMemberUpdate.js b/packages/discord.js/src/client/actions/GuildMemberUpdate.js index 9561ab82abb29..bdb07f74082f1 100644 --- a/packages/discord.js/src/client/actions/GuildMemberUpdate.js +++ b/packages/discord.js/src/client/actions/GuildMemberUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildMemberUpdateAction extends Action { handle(data) { @@ -40,4 +40,4 @@ class GuildMemberUpdateAction extends Action { } } -module.exports = GuildMemberUpdateAction; +exports.GuildMemberUpdateAction = GuildMemberUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildRoleCreate.js b/packages/discord.js/src/client/actions/GuildRoleCreate.js index 461443bdb2179..a379e87593334 100644 --- a/packages/discord.js/src/client/actions/GuildRoleCreate.js +++ b/packages/discord.js/src/client/actions/GuildRoleCreate.js @@ -1,9 +1,9 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); -class GuildRoleCreate extends Action { +class GuildRoleCreateAction extends Action { handle(data) { const client = this.client; const guild = client.guilds.cache.get(data.guild_id); @@ -22,4 +22,4 @@ class GuildRoleCreate extends Action { } } -module.exports = GuildRoleCreate; +exports.GuildRoleCreateAction = GuildRoleCreateAction; diff --git a/packages/discord.js/src/client/actions/GuildRoleDelete.js b/packages/discord.js/src/client/actions/GuildRoleDelete.js index e043a1aeb4049..882ae8278ec01 100644 --- a/packages/discord.js/src/client/actions/GuildRoleDelete.js +++ b/packages/discord.js/src/client/actions/GuildRoleDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildRoleDeleteAction extends Action { handle(data) { @@ -26,4 +26,4 @@ class GuildRoleDeleteAction extends Action { } } -module.exports = GuildRoleDeleteAction; +exports.GuildRoleDeleteAction = GuildRoleDeleteAction; diff --git a/packages/discord.js/src/client/actions/GuildRoleUpdate.js b/packages/discord.js/src/client/actions/GuildRoleUpdate.js index b0632c599a5ef..6433dc235b4ca 100644 --- a/packages/discord.js/src/client/actions/GuildRoleUpdate.js +++ b/packages/discord.js/src/client/actions/GuildRoleUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildRoleUpdateAction extends Action { handle(data) { @@ -36,4 +36,4 @@ class GuildRoleUpdateAction extends Action { } } -module.exports = GuildRoleUpdateAction; +exports.GuildRoleUpdateAction = GuildRoleUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildRolesPositionUpdate.js b/packages/discord.js/src/client/actions/GuildRolesPositionUpdate.js index d7abca97b5a37..1fa090395c85d 100644 --- a/packages/discord.js/src/client/actions/GuildRolesPositionUpdate.js +++ b/packages/discord.js/src/client/actions/GuildRolesPositionUpdate.js @@ -1,8 +1,8 @@ 'use strict'; -const Action = require('./Action'); +const { Action } = require('./Action'); -class GuildRolesPositionUpdate extends Action { +class GuildRolesPositionUpdateAction extends Action { handle(data) { const client = this.client; @@ -18,4 +18,4 @@ class GuildRolesPositionUpdate extends Action { } } -module.exports = GuildRolesPositionUpdate; +exports.GuildRolesPositionUpdateAction = GuildRolesPositionUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildScheduledEventCreate.js b/packages/discord.js/src/client/actions/GuildScheduledEventCreate.js index 0a2fb9b6b964c..0f249d11fd5c7 100644 --- a/packages/discord.js/src/client/actions/GuildScheduledEventCreate.js +++ b/packages/discord.js/src/client/actions/GuildScheduledEventCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildScheduledEventCreateAction extends Action { handle(data) { @@ -24,4 +24,4 @@ class GuildScheduledEventCreateAction extends Action { } } -module.exports = GuildScheduledEventCreateAction; +exports.GuildScheduledEventCreateAction = GuildScheduledEventCreateAction; diff --git a/packages/discord.js/src/client/actions/GuildScheduledEventDelete.js b/packages/discord.js/src/client/actions/GuildScheduledEventDelete.js index 636bfc5dd250f..eea8bb6f01d6b 100644 --- a/packages/discord.js/src/client/actions/GuildScheduledEventDelete.js +++ b/packages/discord.js/src/client/actions/GuildScheduledEventDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildScheduledEventDeleteAction extends Action { handle(data) { @@ -28,4 +28,4 @@ class GuildScheduledEventDeleteAction extends Action { } } -module.exports = GuildScheduledEventDeleteAction; +exports.GuildScheduledEventDeleteAction = GuildScheduledEventDeleteAction; diff --git a/packages/discord.js/src/client/actions/GuildScheduledEventUpdate.js b/packages/discord.js/src/client/actions/GuildScheduledEventUpdate.js index 7cabd850bfcd1..3cd8167cd245d 100644 --- a/packages/discord.js/src/client/actions/GuildScheduledEventUpdate.js +++ b/packages/discord.js/src/client/actions/GuildScheduledEventUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildScheduledEventUpdateAction extends Action { handle(data) { @@ -27,4 +27,4 @@ class GuildScheduledEventUpdateAction extends Action { } } -module.exports = GuildScheduledEventUpdateAction; +exports.GuildScheduledEventUpdateAction = GuildScheduledEventUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildScheduledEventUserAdd.js b/packages/discord.js/src/client/actions/GuildScheduledEventUserAdd.js index 03520db9b9cfc..2055b6a8a98f4 100644 --- a/packages/discord.js/src/client/actions/GuildScheduledEventUserAdd.js +++ b/packages/discord.js/src/client/actions/GuildScheduledEventUserAdd.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildScheduledEventUserAddAction extends Action { handle(data) { @@ -29,4 +29,4 @@ class GuildScheduledEventUserAddAction extends Action { } } -module.exports = GuildScheduledEventUserAddAction; +exports.GuildScheduledEventUserAddAction = GuildScheduledEventUserAddAction; diff --git a/packages/discord.js/src/client/actions/GuildScheduledEventUserRemove.js b/packages/discord.js/src/client/actions/GuildScheduledEventUserRemove.js index 2a048494eeae6..1567847cdeb9f 100644 --- a/packages/discord.js/src/client/actions/GuildScheduledEventUserRemove.js +++ b/packages/discord.js/src/client/actions/GuildScheduledEventUserRemove.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildScheduledEventUserRemoveAction extends Action { handle(data) { @@ -29,4 +29,4 @@ class GuildScheduledEventUserRemoveAction extends Action { } } -module.exports = GuildScheduledEventUserRemoveAction; +exports.GuildScheduledEventUserRemoveAction = GuildScheduledEventUserRemoveAction; diff --git a/packages/discord.js/src/client/actions/GuildStickerCreate.js b/packages/discord.js/src/client/actions/GuildStickerCreate.js index 7d81de97d8555..5e280d11727ef 100644 --- a/packages/discord.js/src/client/actions/GuildStickerCreate.js +++ b/packages/discord.js/src/client/actions/GuildStickerCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildStickerCreateAction extends Action { handle(guild, createdSticker) { @@ -17,4 +17,4 @@ class GuildStickerCreateAction extends Action { } } -module.exports = GuildStickerCreateAction; +exports.GuildStickerCreateAction = GuildStickerCreateAction; diff --git a/packages/discord.js/src/client/actions/GuildStickerDelete.js b/packages/discord.js/src/client/actions/GuildStickerDelete.js index 7fd6b5749ebbc..36fa65679fab5 100644 --- a/packages/discord.js/src/client/actions/GuildStickerDelete.js +++ b/packages/discord.js/src/client/actions/GuildStickerDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildStickerDeleteAction extends Action { handle(sticker) { @@ -16,4 +16,4 @@ class GuildStickerDeleteAction extends Action { } } -module.exports = GuildStickerDeleteAction; +exports.GuildStickerDeleteAction = GuildStickerDeleteAction; diff --git a/packages/discord.js/src/client/actions/GuildStickerUpdate.js b/packages/discord.js/src/client/actions/GuildStickerUpdate.js index 5561c7e825eb6..28e5985910405 100644 --- a/packages/discord.js/src/client/actions/GuildStickerUpdate.js +++ b/packages/discord.js/src/client/actions/GuildStickerUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildStickerUpdateAction extends Action { handle(current, data) { @@ -17,4 +17,4 @@ class GuildStickerUpdateAction extends Action { } } -module.exports = GuildStickerUpdateAction; +exports.GuildStickerUpdateAction = GuildStickerUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildStickersUpdate.js b/packages/discord.js/src/client/actions/GuildStickersUpdate.js index ccf1d639c813a..3fd1cbd364ca2 100644 --- a/packages/discord.js/src/client/actions/GuildStickersUpdate.js +++ b/packages/discord.js/src/client/actions/GuildStickersUpdate.js @@ -1,6 +1,6 @@ 'use strict'; -const Action = require('./Action'); +const { Action } = require('./Action'); class GuildStickersUpdateAction extends Action { handle(data) { @@ -31,4 +31,4 @@ class GuildStickersUpdateAction extends Action { } } -module.exports = GuildStickersUpdateAction; +exports.GuildStickersUpdateAction = GuildStickersUpdateAction; diff --git a/packages/discord.js/src/client/actions/GuildUpdate.js b/packages/discord.js/src/client/actions/GuildUpdate.js index ef1f51bdd1709..92b8e5b163174 100644 --- a/packages/discord.js/src/client/actions/GuildUpdate.js +++ b/packages/discord.js/src/client/actions/GuildUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class GuildUpdateAction extends Action { handle(data) { @@ -30,4 +30,4 @@ class GuildUpdateAction extends Action { } } -module.exports = GuildUpdateAction; +exports.GuildUpdateAction = GuildUpdateAction; diff --git a/packages/discord.js/src/client/actions/InteractionCreate.js b/packages/discord.js/src/client/actions/InteractionCreate.js index 434fb0c0689c3..98c197153702e 100644 --- a/packages/discord.js/src/client/actions/InteractionCreate.js +++ b/packages/discord.js/src/client/actions/InteractionCreate.js @@ -1,19 +1,19 @@ 'use strict'; const { InteractionType, ComponentType, ApplicationCommandType } = require('discord-api-types/v10'); -const Action = require('./Action'); -const AutocompleteInteraction = require('../../structures/AutocompleteInteraction'); -const ButtonInteraction = require('../../structures/ButtonInteraction'); -const ChannelSelectMenuInteraction = require('../../structures/ChannelSelectMenuInteraction'); -const ChatInputCommandInteraction = require('../../structures/ChatInputCommandInteraction'); -const MentionableSelectMenuInteraction = require('../../structures/MentionableSelectMenuInteraction'); -const MessageContextMenuCommandInteraction = require('../../structures/MessageContextMenuCommandInteraction'); -const ModalSubmitInteraction = require('../../structures/ModalSubmitInteraction'); -const RoleSelectMenuInteraction = require('../../structures/RoleSelectMenuInteraction'); -const StringSelectMenuInteraction = require('../../structures/StringSelectMenuInteraction'); -const UserContextMenuCommandInteraction = require('../../structures/UserContextMenuCommandInteraction'); -const UserSelectMenuInteraction = require('../../structures/UserSelectMenuInteraction'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { AutocompleteInteraction } = require('../../structures/AutocompleteInteraction'); +const { ButtonInteraction } = require('../../structures/ButtonInteraction'); +const { ChannelSelectMenuInteraction } = require('../../structures/ChannelSelectMenuInteraction'); +const { ChatInputCommandInteraction } = require('../../structures/ChatInputCommandInteraction'); +const { MentionableSelectMenuInteraction } = require('../../structures/MentionableSelectMenuInteraction'); +const { MessageContextMenuCommandInteraction } = require('../../structures/MessageContextMenuCommandInteraction'); +const { ModalSubmitInteraction } = require('../../structures/ModalSubmitInteraction'); +const { RoleSelectMenuInteraction } = require('../../structures/RoleSelectMenuInteraction'); +const { StringSelectMenuInteraction } = require('../../structures/StringSelectMenuInteraction'); +const { UserContextMenuCommandInteraction } = require('../../structures/UserContextMenuCommandInteraction'); +const { UserSelectMenuInteraction } = require('../../structures/UserSelectMenuInteraction'); +const { Events } = require('../../util/Events'); class InteractionCreateAction extends Action { handle(data) { @@ -98,4 +98,4 @@ class InteractionCreateAction extends Action { } } -module.exports = InteractionCreateAction; +exports.InteractionCreateAction = InteractionCreateAction; diff --git a/packages/discord.js/src/client/actions/InviteCreate.js b/packages/discord.js/src/client/actions/InviteCreate.js index dc03f07a23156..850f3b8f509fb 100644 --- a/packages/discord.js/src/client/actions/InviteCreate.js +++ b/packages/discord.js/src/client/actions/InviteCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class InviteCreateAction extends Action { handle(data) { @@ -24,4 +24,4 @@ class InviteCreateAction extends Action { } } -module.exports = InviteCreateAction; +exports.InviteCreateAction = InviteCreateAction; diff --git a/packages/discord.js/src/client/actions/InviteDelete.js b/packages/discord.js/src/client/actions/InviteDelete.js index 58be00c81c96a..629278eacf827 100644 --- a/packages/discord.js/src/client/actions/InviteDelete.js +++ b/packages/discord.js/src/client/actions/InviteDelete.js @@ -1,8 +1,8 @@ 'use strict'; -const Action = require('./Action'); -const Invite = require('../../structures/Invite'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Invite } = require('../../structures/Invite'); +const { Events } = require('../../util/Events'); class InviteDeleteAction extends Action { handle(data) { @@ -26,4 +26,4 @@ class InviteDeleteAction extends Action { } } -module.exports = InviteDeleteAction; +exports.InviteDeleteAction = InviteDeleteAction; diff --git a/packages/discord.js/src/client/actions/MessageCreate.js b/packages/discord.js/src/client/actions/MessageCreate.js index cba5ab7bf0e02..da0b9057d5777 100644 --- a/packages/discord.js/src/client/actions/MessageCreate.js +++ b/packages/discord.js/src/client/actions/MessageCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class MessageCreateAction extends Action { handle(data) { @@ -38,4 +38,4 @@ class MessageCreateAction extends Action { } } -module.exports = MessageCreateAction; +exports.MessageCreateAction = MessageCreateAction; diff --git a/packages/discord.js/src/client/actions/MessageDelete.js b/packages/discord.js/src/client/actions/MessageDelete.js index c67c5abf0ecf9..9e0aeba0515b3 100644 --- a/packages/discord.js/src/client/actions/MessageDelete.js +++ b/packages/discord.js/src/client/actions/MessageDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class MessageDeleteAction extends Action { handle(data) { @@ -29,4 +29,4 @@ class MessageDeleteAction extends Action { } } -module.exports = MessageDeleteAction; +exports.MessageDeleteAction = MessageDeleteAction; diff --git a/packages/discord.js/src/client/actions/MessageDeleteBulk.js b/packages/discord.js/src/client/actions/MessageDeleteBulk.js index 5f61d19d95508..755489312d37d 100644 --- a/packages/discord.js/src/client/actions/MessageDeleteBulk.js +++ b/packages/discord.js/src/client/actions/MessageDeleteBulk.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class MessageDeleteBulkAction extends Action { handle(data) { @@ -44,4 +44,4 @@ class MessageDeleteBulkAction extends Action { } } -module.exports = MessageDeleteBulkAction; +exports.MessageDeleteBulkAction = MessageDeleteBulkAction; diff --git a/packages/discord.js/src/client/actions/MessagePollVoteAdd.js b/packages/discord.js/src/client/actions/MessagePollVoteAdd.js index 411467ca3d1f1..8157437d9a334 100644 --- a/packages/discord.js/src/client/actions/MessagePollVoteAdd.js +++ b/packages/discord.js/src/client/actions/MessagePollVoteAdd.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class MessagePollVoteAddAction extends Action { handle(data) { @@ -30,4 +30,4 @@ class MessagePollVoteAddAction extends Action { } } -module.exports = MessagePollVoteAddAction; +exports.MessagePollVoteAddAction = MessagePollVoteAddAction; diff --git a/packages/discord.js/src/client/actions/MessagePollVoteRemove.js b/packages/discord.js/src/client/actions/MessagePollVoteRemove.js index afae556a4b94b..19906228465fc 100644 --- a/packages/discord.js/src/client/actions/MessagePollVoteRemove.js +++ b/packages/discord.js/src/client/actions/MessagePollVoteRemove.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class MessagePollVoteRemoveAction extends Action { handle(data) { @@ -30,4 +30,4 @@ class MessagePollVoteRemoveAction extends Action { } } -module.exports = MessagePollVoteRemoveAction; +exports.MessagePollVoteRemoveAction = MessagePollVoteRemoveAction; diff --git a/packages/discord.js/src/client/actions/MessageReactionAdd.js b/packages/discord.js/src/client/actions/MessageReactionAdd.js index 9e2b40ee8bbf3..e98e5c7c84eac 100644 --- a/packages/discord.js/src/client/actions/MessageReactionAdd.js +++ b/packages/discord.js/src/client/actions/MessageReactionAdd.js @@ -1,8 +1,8 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); -const Partials = require('../../util/Partials'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); +const { Partials } = require('../../util/Partials'); /* { user_id: 'id', @@ -15,7 +15,7 @@ const Partials = require('../../util/Partials'); member: { ..., user: { ... } } } */ -class MessageReactionAdd extends Action { +class MessageReactionAddAction extends Action { handle(data, fromStructure = false) { if (!data.emoji) return false; @@ -67,4 +67,4 @@ class MessageReactionAdd extends Action { } } -module.exports = MessageReactionAdd; +exports.MessageReactionAddAction = MessageReactionAddAction; diff --git a/packages/discord.js/src/client/actions/MessageReactionRemove.js b/packages/discord.js/src/client/actions/MessageReactionRemove.js index 132edc14a3357..363d61690120d 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemove.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemove.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); /* { user_id: 'id', @@ -11,7 +11,7 @@ const Events = require('../../util/Events'); guild_id: 'id' } */ -class MessageReactionRemove extends Action { +class MessageReactionRemoveAction extends Action { handle(data) { if (!data.emoji) return false; @@ -47,4 +47,4 @@ class MessageReactionRemove extends Action { } } -module.exports = MessageReactionRemove; +exports.MessageReactionRemoveAction = MessageReactionRemoveAction; diff --git a/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js b/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js index df3d5001cb6ca..541cbfda50cf8 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemoveAll.js @@ -1,9 +1,9 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); -class MessageReactionRemoveAll extends Action { +class MessageReactionRemoveAllAction extends Action { handle(data) { // Verify channel const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); @@ -30,4 +30,4 @@ class MessageReactionRemoveAll extends Action { * @param {Collection} reactions The cached message reactions that were removed. */ -module.exports = MessageReactionRemoveAll; +exports.MessageReactionRemoveAllAction = MessageReactionRemoveAllAction; diff --git a/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js b/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js index 4f8706317ee64..42cc6c532fd5b 100644 --- a/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js +++ b/packages/discord.js/src/client/actions/MessageReactionRemoveEmoji.js @@ -1,9 +1,9 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); -class MessageReactionRemoveEmoji extends Action { +class MessageReactionRemoveEmojiAction extends Action { handle(data) { const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel?.isTextBased()) return false; @@ -25,4 +25,4 @@ class MessageReactionRemoveEmoji extends Action { } } -module.exports = MessageReactionRemoveEmoji; +exports.MessageReactionRemoveEmojiAction = MessageReactionRemoveEmojiAction; diff --git a/packages/discord.js/src/client/actions/MessageUpdate.js b/packages/discord.js/src/client/actions/MessageUpdate.js index 4aa4f84def5c3..7f517af50cd41 100644 --- a/packages/discord.js/src/client/actions/MessageUpdate.js +++ b/packages/discord.js/src/client/actions/MessageUpdate.js @@ -1,6 +1,6 @@ 'use strict'; -const Action = require('./Action'); +const { Action } = require('./Action'); class MessageUpdateAction extends Action { handle(data) { @@ -23,4 +23,4 @@ class MessageUpdateAction extends Action { } } -module.exports = MessageUpdateAction; +exports.MessageUpdateAction = MessageUpdateAction; diff --git a/packages/discord.js/src/client/actions/PresenceUpdate.js b/packages/discord.js/src/client/actions/PresenceUpdate.js index 0b4aaab75579f..4efa295773b83 100644 --- a/packages/discord.js/src/client/actions/PresenceUpdate.js +++ b/packages/discord.js/src/client/actions/PresenceUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class PresenceUpdateAction extends Action { handle(data) { @@ -39,4 +39,4 @@ class PresenceUpdateAction extends Action { } } -module.exports = PresenceUpdateAction; +exports.PresenceUpdateAction = PresenceUpdateAction; diff --git a/packages/discord.js/src/client/actions/StageInstanceCreate.js b/packages/discord.js/src/client/actions/StageInstanceCreate.js index 1f3eb90670c6b..db349c8949092 100644 --- a/packages/discord.js/src/client/actions/StageInstanceCreate.js +++ b/packages/discord.js/src/client/actions/StageInstanceCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class StageInstanceCreateAction extends Action { handle(data) { @@ -25,4 +25,4 @@ class StageInstanceCreateAction extends Action { } } -module.exports = StageInstanceCreateAction; +exports.StageInstanceCreateAction = StageInstanceCreateAction; diff --git a/packages/discord.js/src/client/actions/StageInstanceDelete.js b/packages/discord.js/src/client/actions/StageInstanceDelete.js index b11bee2def5fe..f7aa1e8082804 100644 --- a/packages/discord.js/src/client/actions/StageInstanceDelete.js +++ b/packages/discord.js/src/client/actions/StageInstanceDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class StageInstanceDeleteAction extends Action { handle(data) { @@ -28,4 +28,4 @@ class StageInstanceDeleteAction extends Action { } } -module.exports = StageInstanceDeleteAction; +exports.StageInstanceDeleteAction = StageInstanceDeleteAction; diff --git a/packages/discord.js/src/client/actions/StageInstanceUpdate.js b/packages/discord.js/src/client/actions/StageInstanceUpdate.js index 1375527547bb0..d653e182832b7 100644 --- a/packages/discord.js/src/client/actions/StageInstanceUpdate.js +++ b/packages/discord.js/src/client/actions/StageInstanceUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class StageInstanceUpdateAction extends Action { handle(data) { @@ -27,4 +27,4 @@ class StageInstanceUpdateAction extends Action { } } -module.exports = StageInstanceUpdateAction; +exports.StageInstanceUpdateAction = StageInstanceUpdateAction; diff --git a/packages/discord.js/src/client/actions/ThreadCreate.js b/packages/discord.js/src/client/actions/ThreadCreate.js index a8ff6c6ff146f..c8a6d0531e1f3 100644 --- a/packages/discord.js/src/client/actions/ThreadCreate.js +++ b/packages/discord.js/src/client/actions/ThreadCreate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ThreadCreateAction extends Action { handle(data) { @@ -21,4 +21,4 @@ class ThreadCreateAction extends Action { } } -module.exports = ThreadCreateAction; +exports.ThreadCreateAction = ThreadCreateAction; diff --git a/packages/discord.js/src/client/actions/ThreadDelete.js b/packages/discord.js/src/client/actions/ThreadDelete.js index 3ec81a4e4b59f..e9a8e1f660395 100644 --- a/packages/discord.js/src/client/actions/ThreadDelete.js +++ b/packages/discord.js/src/client/actions/ThreadDelete.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ThreadDeleteAction extends Action { handle(data) { @@ -23,4 +23,4 @@ class ThreadDeleteAction extends Action { } } -module.exports = ThreadDeleteAction; +exports.ThreadDeleteAction = ThreadDeleteAction; diff --git a/packages/discord.js/src/client/actions/ThreadListSync.js b/packages/discord.js/src/client/actions/ThreadListSync.js index b336a8c9d6ea6..7de657943097a 100644 --- a/packages/discord.js/src/client/actions/ThreadListSync.js +++ b/packages/discord.js/src/client/actions/ThreadListSync.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ThreadListSyncAction extends Action { handle(data) { @@ -57,4 +57,4 @@ class ThreadListSyncAction extends Action { } } -module.exports = ThreadListSyncAction; +exports.ThreadListSyncAction = ThreadListSyncAction; diff --git a/packages/discord.js/src/client/actions/ThreadMemberUpdate.js b/packages/discord.js/src/client/actions/ThreadMemberUpdate.js index 0b17f7055052d..902331b369fde 100644 --- a/packages/discord.js/src/client/actions/ThreadMemberUpdate.js +++ b/packages/discord.js/src/client/actions/ThreadMemberUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ThreadMemberUpdateAction extends Action { handle(data) { @@ -27,4 +27,4 @@ class ThreadMemberUpdateAction extends Action { } } -module.exports = ThreadMemberUpdateAction; +exports.ThreadMemberUpdateAction = ThreadMemberUpdateAction; diff --git a/packages/discord.js/src/client/actions/ThreadMembersUpdate.js b/packages/discord.js/src/client/actions/ThreadMembersUpdate.js index c1781b9ee0fc2..cad63d2defb3d 100644 --- a/packages/discord.js/src/client/actions/ThreadMembersUpdate.js +++ b/packages/discord.js/src/client/actions/ThreadMembersUpdate.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class ThreadMembersUpdateAction extends Action { handle(data) { @@ -44,4 +44,4 @@ class ThreadMembersUpdateAction extends Action { } } -module.exports = ThreadMembersUpdateAction; +exports.ThreadMembersUpdateAction = ThreadMembersUpdateAction; diff --git a/packages/discord.js/src/client/actions/TypingStart.js b/packages/discord.js/src/client/actions/TypingStart.js index 637edaa3e960c..660a4dbb7627e 100644 --- a/packages/discord.js/src/client/actions/TypingStart.js +++ b/packages/discord.js/src/client/actions/TypingStart.js @@ -1,10 +1,10 @@ 'use strict'; -const Action = require('./Action'); -const Typing = require('../../structures/Typing'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Typing } = require('../../structures/Typing'); +const { Events } = require('../../util/Events'); -class TypingStart extends Action { +class TypingStartAction extends Action { handle(data) { const channel = this.getChannel({ id: data.channel_id, ...('guild_id' in data && { guild_id: data.guild_id }) }); if (!channel) return; @@ -26,4 +26,4 @@ class TypingStart extends Action { } } -module.exports = TypingStart; +exports.TypingStartAction = TypingStartAction; diff --git a/packages/discord.js/src/client/actions/UserUpdate.js b/packages/discord.js/src/client/actions/UserUpdate.js index 923ddf5c05213..523a0c5d3edbc 100644 --- a/packages/discord.js/src/client/actions/UserUpdate.js +++ b/packages/discord.js/src/client/actions/UserUpdate.js @@ -1,7 +1,7 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); class UserUpdateAction extends Action { handle(data) { @@ -33,4 +33,4 @@ class UserUpdateAction extends Action { } } -module.exports = UserUpdateAction; +exports.UserUpdateAction = UserUpdateAction; diff --git a/packages/discord.js/src/client/actions/VoiceStateUpdate.js b/packages/discord.js/src/client/actions/VoiceStateUpdate.js index fc7400f2e6ac2..b06aa9c245ccd 100644 --- a/packages/discord.js/src/client/actions/VoiceStateUpdate.js +++ b/packages/discord.js/src/client/actions/VoiceStateUpdate.js @@ -1,10 +1,10 @@ 'use strict'; -const Action = require('./Action'); -const VoiceState = require('../../structures/VoiceState'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { VoiceState } = require('../../structures/VoiceState'); +const { Events } = require('../../util/Events'); -class VoiceStateUpdate extends Action { +class VoiceStateUpdateAction extends Action { handle(data) { const client = this.client; const guild = client.guilds.cache.get(data.guild_id); @@ -40,4 +40,4 @@ class VoiceStateUpdate extends Action { } } -module.exports = VoiceStateUpdate; +exports.VoiceStateUpdateAction = VoiceStateUpdateAction; diff --git a/packages/discord.js/src/client/actions/WebhooksUpdate.js b/packages/discord.js/src/client/actions/WebhooksUpdate.js index 53dbfc1757a45..1d7f6f7750d78 100644 --- a/packages/discord.js/src/client/actions/WebhooksUpdate.js +++ b/packages/discord.js/src/client/actions/WebhooksUpdate.js @@ -1,9 +1,9 @@ 'use strict'; -const Action = require('./Action'); -const Events = require('../../util/Events'); +const { Action } = require('./Action'); +const { Events } = require('../../util/Events'); -class WebhooksUpdate extends Action { +class WebhooksUpdateAction extends Action { handle(data) { const client = this.client; const channel = client.channels.cache.get(data.channel_id); @@ -19,4 +19,4 @@ class WebhooksUpdate extends Action { } } -module.exports = WebhooksUpdate; +exports.WebhooksUpdateAction = WebhooksUpdateAction; diff --git a/packages/discord.js/src/client/voice/ClientVoiceManager.js b/packages/discord.js/src/client/voice/ClientVoiceManager.js index 520dd40cfb301..df3df1b0c63bd 100644 --- a/packages/discord.js/src/client/voice/ClientVoiceManager.js +++ b/packages/discord.js/src/client/voice/ClientVoiceManager.js @@ -43,4 +43,4 @@ class ClientVoiceManager { } } -module.exports = ClientVoiceManager; +exports.ClientVoiceManager = ClientVoiceManager; diff --git a/packages/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js b/packages/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js index c46e527271516..ec387130a3ef1 100644 --- a/packages/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +++ b/packages/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const channel = client.channels.cache.get(data.channel_id); diff --git a/packages/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js b/packages/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js index 8f35121b0a7d3..2e2a878abfe27 100644 --- a/packages/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js +++ b/packages/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, packet) => { const { old, updated } = client.actions.ChannelUpdate.handle(packet.d); diff --git a/packages/discord.js/src/client/websocket/handlers/GUILD_CREATE.js b/packages/discord.js/src/client/websocket/handlers/GUILD_CREATE.js index 87d724b585c9f..40931a2894155 100644 --- a/packages/discord.js/src/client/websocket/handlers/GUILD_CREATE.js +++ b/packages/discord.js/src/client/websocket/handlers/GUILD_CREATE.js @@ -1,7 +1,7 @@ 'use strict'; -const Events = require('../../../util/Events'); -const Status = require('../../../util/Status'); +const { Events } = require('../../../util/Events'); +const { Status } = require('../../../util/Status'); module.exports = (client, { d: data }, shardId) => { let guild = client.guilds.cache.get(data.id); diff --git a/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js b/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js index 2f61a1ea2c275..30ae396527c1b 100644 --- a/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +++ b/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const guild = client.guilds.cache.get(data.guild_id); diff --git a/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js b/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js index 53faae51fd5e2..b54c5c0433909 100644 --- a/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +++ b/packages/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const guild = client.guilds.cache.get(data.guild_id); diff --git a/packages/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js b/packages/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js index c2a470bf75977..6525904d906a3 100644 --- a/packages/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js +++ b/packages/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, packet) => { const { old, updated } = client.actions.MessageUpdate.handle(packet.d); diff --git a/packages/discord.js/src/client/websocket/handlers/READY.js b/packages/discord.js/src/client/websocket/handlers/READY.js index 5ff8902480721..6c507d03e10a6 100644 --- a/packages/discord.js/src/client/websocket/handlers/READY.js +++ b/packages/discord.js/src/client/websocket/handlers/READY.js @@ -1,6 +1,6 @@ 'use strict'; -const ClientApplication = require('../../../structures/ClientApplication'); +const { ClientApplication } = require('../../../structures/ClientApplication'); let ClientUser; module.exports = (client, { d: data }, shardId) => { diff --git a/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js b/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js index 4a5ad79e1bd09..55ba5eb6c500b 100644 --- a/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js +++ b/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const subscription = client.application.subscriptions._add(data); diff --git a/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js b/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js index dc39303353545..5af783f272e5c 100644 --- a/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js +++ b/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const subscription = client.application.subscriptions._add(data, false); diff --git a/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js b/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js index 33a3c3fec2f87..16216cb83e123 100644 --- a/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js +++ b/packages/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const oldSubscription = client.application.subscriptions.cache.get(data.id)?._clone() ?? null; diff --git a/packages/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js b/packages/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js index 481dcd4763652..94a81e34990bc 100644 --- a/packages/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js +++ b/packages/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js @@ -1,6 +1,6 @@ 'use strict'; -const Events = require('../../../util/Events'); +const { Events } = require('../../../util/Events'); module.exports = (client, packet) => { const { old, updated } = client.actions.ChannelUpdate.handle(packet.d); diff --git a/packages/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js b/packages/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js index 36f37db799c9d..a621c8ea106a6 100644 --- a/packages/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js +++ b/packages/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js @@ -1,7 +1,7 @@ 'use strict'; -const VoiceChannelEffect = require('../../../structures/VoiceChannelEffect'); -const Events = require('../../../util/Events'); +const { VoiceChannelEffect } = require('../../../structures/VoiceChannelEffect'); +const { Events } = require('../../../util/Events'); module.exports = (client, { d: data }) => { const guild = client.guilds.cache.get(data.guild_id); diff --git a/packages/discord.js/src/client/websocket/handlers/index.js b/packages/discord.js/src/client/websocket/handlers/index.js index eb1abdd28f415..6cf762de71dbb 100644 --- a/packages/discord.js/src/client/websocket/handlers/index.js +++ b/packages/discord.js/src/client/websocket/handlers/index.js @@ -1,6 +1,6 @@ 'use strict'; -const handlers = Object.fromEntries([ +const PacketHandlers = Object.fromEntries([ ['APPLICATION_COMMAND_PERMISSIONS_UPDATE', require('./APPLICATION_COMMAND_PERMISSIONS_UPDATE')], ['AUTO_MODERATION_ACTION_EXECUTION', require('./AUTO_MODERATION_ACTION_EXECUTION')], ['AUTO_MODERATION_RULE_CREATE', require('./AUTO_MODERATION_RULE_CREATE')], @@ -69,4 +69,4 @@ const handlers = Object.fromEntries([ ['WEBHOOKS_UPDATE', require('./WEBHOOKS_UPDATE')], ]); -module.exports = handlers; +exports.PacketHandlers = PacketHandlers; diff --git a/packages/discord.js/src/errors/DJSError.js b/packages/discord.js/src/errors/DJSError.js index 88e0e7299ba01..e04b2ee21de97 100644 --- a/packages/discord.js/src/errors/DJSError.js +++ b/packages/discord.js/src/errors/DJSError.js @@ -1,8 +1,8 @@ 'use strict'; // Heavily inspired by node's `internal/errors` module -const ErrorCodes = require('./ErrorCodes'); -const Messages = require('./Messages'); +const { ErrorCodes } = require('./ErrorCodes'); +const { Messages } = require('./Messages'); /** * Extend an error of some sort into a DiscordjsError. diff --git a/packages/discord.js/src/errors/ErrorCodes.js b/packages/discord.js/src/errors/ErrorCodes.js index b160068e7669c..fcb15d30fe6f6 100644 --- a/packages/discord.js/src/errors/ErrorCodes.js +++ b/packages/discord.js/src/errors/ErrorCodes.js @@ -265,4 +265,6 @@ const keys = [ * @type {DiscordjsErrorCodes} * @ignore */ -module.exports = Object.fromEntries(keys.map(key => [key, key])); +const ErrorCodes = Object.fromEntries(keys.map(key => [key, key])); + +exports.ErrorCodes = ErrorCodes; diff --git a/packages/discord.js/src/errors/Messages.js b/packages/discord.js/src/errors/Messages.js index 133c4d0cee500..b5185a7b2e822 100644 --- a/packages/discord.js/src/errors/Messages.js +++ b/packages/discord.js/src/errors/Messages.js @@ -1,149 +1,149 @@ 'use strict'; -const DjsErrorCodes = require('./ErrorCodes'); +const { ErrorCodes } = require('./ErrorCodes'); const Messages = { - [DjsErrorCodes.ClientInvalidOption]: (prop, must) => `The ${prop} option must be ${must}`, - [DjsErrorCodes.ClientInvalidProvidedShards]: 'None of the provided shards were valid.', - [DjsErrorCodes.ClientMissingIntents]: 'Valid intents must be provided for the Client.', - [DjsErrorCodes.ClientNotReady]: action => `The client needs to be logged in to ${action}.`, - - [DjsErrorCodes.TokenInvalid]: 'An invalid token was provided.', - [DjsErrorCodes.TokenMissing]: 'Request to use token, but token was unavailable to the client.', - [DjsErrorCodes.ApplicationCommandPermissionsTokenMissing]: + [ErrorCodes.ClientInvalidOption]: (prop, must) => `The ${prop} option must be ${must}`, + [ErrorCodes.ClientInvalidProvidedShards]: 'None of the provided shards were valid.', + [ErrorCodes.ClientMissingIntents]: 'Valid intents must be provided for the Client.', + [ErrorCodes.ClientNotReady]: action => `The client needs to be logged in to ${action}.`, + + [ErrorCodes.TokenInvalid]: 'An invalid token was provided.', + [ErrorCodes.TokenMissing]: 'Request to use token, but token was unavailable to the client.', + [ErrorCodes.ApplicationCommandPermissionsTokenMissing]: 'Editing application command permissions requires an OAuth2 bearer token, but none was provided.', - [DjsErrorCodes.BitFieldInvalid]: bit => `Invalid bitfield flag or number: ${bit}.`, - - [DjsErrorCodes.ShardingNoShards]: 'No shards have been spawned.', - [DjsErrorCodes.ShardingInProcess]: 'Shards are still being spawned.', - [DjsErrorCodes.ShardingInvalidEvalBroadcast]: 'Script to evaluate must be a function', - [DjsErrorCodes.ShardingShardNotFound]: id => `Shard ${id} could not be found.`, - [DjsErrorCodes.ShardingAlreadySpawned]: count => `Already spawned ${count} shards.`, - [DjsErrorCodes.ShardingProcessExists]: id => `Shard ${id} already has an active process.`, - [DjsErrorCodes.ShardingWorkerExists]: id => `Shard ${id} already has an active worker.`, - [DjsErrorCodes.ShardingReadyTimeout]: id => `Shard ${id}'s Client took too long to become ready.`, - [DjsErrorCodes.ShardingReadyDisconnected]: id => `Shard ${id}'s Client disconnected before becoming ready.`, - [DjsErrorCodes.ShardingReadyDied]: id => `Shard ${id}'s process exited before its Client became ready.`, - [DjsErrorCodes.ShardingNoChildExists]: id => `Shard ${id} has no active process or worker.`, - [DjsErrorCodes.ShardingShardMiscalculation]: (shard, guild, count) => + [ErrorCodes.BitFieldInvalid]: bit => `Invalid bitfield flag or number: ${bit}.`, + + [ErrorCodes.ShardingNoShards]: 'No shards have been spawned.', + [ErrorCodes.ShardingInProcess]: 'Shards are still being spawned.', + [ErrorCodes.ShardingInvalidEvalBroadcast]: 'Script to evaluate must be a function', + [ErrorCodes.ShardingShardNotFound]: id => `Shard ${id} could not be found.`, + [ErrorCodes.ShardingAlreadySpawned]: count => `Already spawned ${count} shards.`, + [ErrorCodes.ShardingProcessExists]: id => `Shard ${id} already has an active process.`, + [ErrorCodes.ShardingWorkerExists]: id => `Shard ${id} already has an active worker.`, + [ErrorCodes.ShardingReadyTimeout]: id => `Shard ${id}'s Client took too long to become ready.`, + [ErrorCodes.ShardingReadyDisconnected]: id => `Shard ${id}'s Client disconnected before becoming ready.`, + [ErrorCodes.ShardingReadyDied]: id => `Shard ${id}'s process exited before its Client became ready.`, + [ErrorCodes.ShardingNoChildExists]: id => `Shard ${id} has no active process or worker.`, + [ErrorCodes.ShardingShardMiscalculation]: (shard, guild, count) => `Calculated invalid shard ${shard} for guild ${guild} with ${count} shards.`, - [DjsErrorCodes.ColorRange]: 'Color must be within the range 0 - 16777215 (0xFFFFFF).', - [DjsErrorCodes.ColorConvert]: color => `Unable to convert "${color}" to a number.`, + [ErrorCodes.ColorRange]: 'Color must be within the range 0 - 16777215 (0xFFFFFF).', + [ErrorCodes.ColorConvert]: color => `Unable to convert "${color}" to a number.`, - [DjsErrorCodes.InviteOptionsMissingChannel]: + [ErrorCodes.InviteOptionsMissingChannel]: 'A valid guild channel must be provided when GuildScheduledEvent is EXTERNAL.', - [DjsErrorCodes.InteractionCollectorError]: reason => + [ErrorCodes.InteractionCollectorError]: reason => `Collector received no interactions before ending with reason: ${reason}`, - [DjsErrorCodes.FileNotFound]: file => `File could not be found: ${file}`, + [ErrorCodes.FileNotFound]: file => `File could not be found: ${file}`, - [DjsErrorCodes.UserNoDMChannel]: 'No DM Channel exists!', + [ErrorCodes.UserNoDMChannel]: 'No DM Channel exists!', - [DjsErrorCodes.VoiceNotStageChannel]: 'You are only allowed to do this in stage channels.', + [ErrorCodes.VoiceNotStageChannel]: 'You are only allowed to do this in stage channels.', - [DjsErrorCodes.VoiceStateNotOwn]: + [ErrorCodes.VoiceStateNotOwn]: 'You cannot self-deafen/mute/request to speak on VoiceStates that do not belong to the ClientUser.', - [DjsErrorCodes.VoiceStateInvalidType]: name => `${name} must be a boolean.`, - - [DjsErrorCodes.ReqResourceType]: 'The resource must be a string, Buffer or a valid file stream.', - - [DjsErrorCodes.MessageBulkDeleteType]: 'The messages must be an Array, Collection, or number.', - [DjsErrorCodes.MessageContentType]: 'Message content must be a string.', - [DjsErrorCodes.MessageNonceRequired]: 'Message nonce is required when enforceNonce is true.', - [DjsErrorCodes.MessageNonceType]: 'Message nonce must be an integer or a string.', - - [DjsErrorCodes.BanResolveId]: (ban = false) => `Couldn't resolve the user id to ${ban ? 'ban' : 'unban'}.`, - [DjsErrorCodes.FetchBanResolveId]: "Couldn't resolve the user id to fetch the ban.", - - [DjsErrorCodes.PruneDaysType]: 'Days must be a number', - - [DjsErrorCodes.GuildChannelResolve]: 'Could not resolve channel to a guild channel.', - [DjsErrorCodes.GuildVoiceChannelResolve]: 'Could not resolve channel to a guild voice channel.', - [DjsErrorCodes.GuildChannelOrphan]: 'Could not find a parent to this guild channel.', - [DjsErrorCodes.GuildChannelUnowned]: "The fetched channel does not belong to this manager's guild.", - [DjsErrorCodes.GuildOwned]: 'Guild is owned by the client.', - [DjsErrorCodes.GuildMembersTimeout]: "Members didn't arrive in time.", - [DjsErrorCodes.GuildUncachedMe]: 'The client user as a member of this guild is uncached.', - [DjsErrorCodes.ChannelNotCached]: 'Could not find the channel where this message came from in the cache!', - [DjsErrorCodes.StageChannelResolve]: 'Could not resolve channel to a stage channel.', - [DjsErrorCodes.GuildScheduledEventResolve]: 'Could not resolve the guild scheduled event.', - [DjsErrorCodes.FetchOwnerId]: type => `Couldn't resolve the ${type} ownerId to fetch the ${type} member.`, - - [DjsErrorCodes.InvalidType]: (name, expected, an = false) => `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`, - [DjsErrorCodes.InvalidElement]: (type, name, elem) => `Supplied ${type} ${name} includes an invalid element: ${elem}`, - - [DjsErrorCodes.MessageThreadParent]: 'The message was not sent in a guild text or announcement channel', - [DjsErrorCodes.MessageExistingThread]: 'The message already has a thread', - [DjsErrorCodes.ThreadInvitableType]: type => `Invitable cannot be edited on ${type}`, - [DjsErrorCodes.NotAThreadOfParent]: 'Provided ThreadChannelResolvable is not a thread of the parent channel.', - - [DjsErrorCodes.WebhookMessage]: 'The message was not sent by a webhook.', - [DjsErrorCodes.WebhookTokenUnavailable]: 'This action requires a webhook token, but none is available.', - [DjsErrorCodes.WebhookURLInvalid]: 'The provided webhook URL is not valid.', - [DjsErrorCodes.WebhookApplication]: 'This message webhook belongs to an application and cannot be fetched.', - [DjsErrorCodes.MessageReferenceMissing]: 'The message does not reference another message', - - [DjsErrorCodes.EmojiType]: 'Emoji must be a string or GuildEmoji/ReactionEmoji', - [DjsErrorCodes.EmojiManaged]: 'Emoji is managed and has no Author.', - [DjsErrorCodes.MissingManageGuildExpressionsPermission]: guild => + [ErrorCodes.VoiceStateInvalidType]: name => `${name} must be a boolean.`, + + [ErrorCodes.ReqResourceType]: 'The resource must be a string, Buffer or a valid file stream.', + + [ErrorCodes.MessageBulkDeleteType]: 'The messages must be an Array, Collection, or number.', + [ErrorCodes.MessageContentType]: 'Message content must be a string.', + [ErrorCodes.MessageNonceRequired]: 'Message nonce is required when enforceNonce is true.', + [ErrorCodes.MessageNonceType]: 'Message nonce must be an integer or a string.', + + [ErrorCodes.BanResolveId]: (ban = false) => `Couldn't resolve the user id to ${ban ? 'ban' : 'unban'}.`, + [ErrorCodes.FetchBanResolveId]: "Couldn't resolve the user id to fetch the ban.", + + [ErrorCodes.PruneDaysType]: 'Days must be a number', + + [ErrorCodes.GuildChannelResolve]: 'Could not resolve channel to a guild channel.', + [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.GuildUncachedMe]: 'The client user as a member of this guild is uncached.', + [ErrorCodes.ChannelNotCached]: 'Could not find the channel where this message came from in the cache!', + [ErrorCodes.StageChannelResolve]: 'Could not resolve channel to a stage channel.', + [ErrorCodes.GuildScheduledEventResolve]: 'Could not resolve the guild scheduled event.', + [ErrorCodes.FetchOwnerId]: type => `Couldn't resolve the ${type} ownerId to fetch the ${type} member.`, + + [ErrorCodes.InvalidType]: (name, expected, an = false) => `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`, + [ErrorCodes.InvalidElement]: (type, name, elem) => `Supplied ${type} ${name} includes an invalid element: ${elem}`, + + [ErrorCodes.MessageThreadParent]: 'The message was not sent in a guild text or announcement channel', + [ErrorCodes.MessageExistingThread]: 'The message already has a thread', + [ErrorCodes.ThreadInvitableType]: type => `Invitable cannot be edited on ${type}`, + [ErrorCodes.NotAThreadOfParent]: 'Provided ThreadChannelResolvable is not a thread of the parent channel.', + + [ErrorCodes.WebhookMessage]: 'The message was not sent by a webhook.', + [ErrorCodes.WebhookTokenUnavailable]: 'This action requires a webhook token, but none is available.', + [ErrorCodes.WebhookURLInvalid]: 'The provided webhook URL is not valid.', + [ErrorCodes.WebhookApplication]: 'This message webhook belongs to an application and cannot be fetched.', + [ErrorCodes.MessageReferenceMissing]: 'The message does not reference another message', + + [ErrorCodes.EmojiType]: 'Emoji must be a string or GuildEmoji/ReactionEmoji', + [ErrorCodes.EmojiManaged]: 'Emoji is managed and has no Author.', + [ErrorCodes.MissingManageGuildExpressionsPermission]: guild => `Client must have Manage Guild Expressions permission in guild ${guild} to see emoji authors.`, - [DjsErrorCodes.NotGuildSticker]: 'Sticker is a standard (non-guild) sticker and has no author.', + [ErrorCodes.NotGuildSticker]: 'Sticker is a standard (non-guild) sticker and has no author.', - [DjsErrorCodes.ReactionResolveUser]: "Couldn't resolve the user id to remove from the reaction.", + [ErrorCodes.ReactionResolveUser]: "Couldn't resolve the user id to remove from the reaction.", - [DjsErrorCodes.InviteResolveCode]: 'Could not resolve the code to fetch the invite.', + [ErrorCodes.InviteResolveCode]: 'Could not resolve the code to fetch the invite.', - [DjsErrorCodes.InviteNotFound]: 'Could not find the requested invite.', + [ErrorCodes.InviteNotFound]: 'Could not find the requested invite.', - [DjsErrorCodes.DeleteGroupDMChannel]: "Bots don't have access to Group DM Channels and cannot delete them", - [DjsErrorCodes.FetchGroupDMChannel]: "Bots don't have access to Group DM Channels and cannot fetch them", + [ErrorCodes.DeleteGroupDMChannel]: "Bots don't have access to Group DM Channels and cannot delete them", + [ErrorCodes.FetchGroupDMChannel]: "Bots don't have access to Group DM Channels and cannot fetch them", - [DjsErrorCodes.MemberFetchNonceLength]: 'Nonce length must not exceed 32 characters.', + [ErrorCodes.MemberFetchNonceLength]: 'Nonce length must not exceed 32 characters.', - [DjsErrorCodes.GlobalCommandPermissions]: + [ErrorCodes.GlobalCommandPermissions]: 'Permissions for global commands may only be fetched or modified by providing a GuildResolvable ' + "or from a guild's application command manager.", - [DjsErrorCodes.GuildUncachedEntityResolve]: type => + [ErrorCodes.GuildUncachedEntityResolve]: type => `Cannot resolve ${type} from an arbitrary guild, provide an id instead`, - [DjsErrorCodes.InteractionAlreadyReplied]: 'The reply to this interaction has already been sent or deferred.', - [DjsErrorCodes.InteractionNotReplied]: 'The reply to this interaction has not been sent or deferred.', + [ErrorCodes.InteractionAlreadyReplied]: 'The reply to this interaction has already been sent or deferred.', + [ErrorCodes.InteractionNotReplied]: 'The reply to this interaction has not been sent or deferred.', - [DjsErrorCodes.CommandInteractionOptionNotFound]: name => `Required option "${name}" not found.`, - [DjsErrorCodes.CommandInteractionOptionType]: (name, type, expected) => + [ErrorCodes.CommandInteractionOptionNotFound]: name => `Required option "${name}" not found.`, + [ErrorCodes.CommandInteractionOptionType]: (name, type, expected) => `Option "${name}" is of type: ${type}; expected ${expected}.`, - [DjsErrorCodes.CommandInteractionOptionEmpty]: (name, type) => + [ErrorCodes.CommandInteractionOptionEmpty]: (name, type) => `Required option "${name}" is of type: ${type}; expected a non-empty value.`, - [DjsErrorCodes.CommandInteractionOptionNoSubcommand]: 'No subcommand specified for interaction.', - [DjsErrorCodes.CommandInteractionOptionNoSubcommandGroup]: 'No subcommand group specified for interaction.', - [DjsErrorCodes.CommandInteractionOptionInvalidChannelType]: (name, type, expected) => + [ErrorCodes.CommandInteractionOptionNoSubcommand]: 'No subcommand specified for interaction.', + [ErrorCodes.CommandInteractionOptionNoSubcommandGroup]: 'No subcommand group specified for interaction.', + [ErrorCodes.CommandInteractionOptionInvalidChannelType]: (name, type, expected) => `The type of channel of the option "${name}" is: ${type}; expected ${expected}.`, - [DjsErrorCodes.AutocompleteInteractionOptionNoFocusedOption]: 'No focused option for autocomplete interaction.', + [ErrorCodes.AutocompleteInteractionOptionNoFocusedOption]: 'No focused option for autocomplete interaction.', - [DjsErrorCodes.ModalSubmitInteractionFieldNotFound]: customId => + [ErrorCodes.ModalSubmitInteractionFieldNotFound]: customId => `Required field with custom id "${customId}" not found.`, - [DjsErrorCodes.ModalSubmitInteractionFieldType]: (customId, type, expected) => + [ErrorCodes.ModalSubmitInteractionFieldType]: (customId, type, expected) => `Field with custom id "${customId}" is of type: ${type}; expected ${expected}.`, - [DjsErrorCodes.InvalidMissingScopes]: 'At least one valid scope must be provided for the invite', - [DjsErrorCodes.InvalidScopesWithPermissions]: 'Permissions cannot be set without the bot scope.', + [ErrorCodes.InvalidMissingScopes]: 'At least one valid scope must be provided for the invite', + [ErrorCodes.InvalidScopesWithPermissions]: 'Permissions cannot be set without the bot scope.', - [DjsErrorCodes.NotImplemented]: (what, name) => `Method ${what} not implemented on ${name}.`, + [ErrorCodes.NotImplemented]: (what, name) => `Method ${what} not implemented on ${name}.`, - [DjsErrorCodes.SweepFilterReturn]: 'The return value of the sweepFilter function was not false or a Function', + [ErrorCodes.SweepFilterReturn]: 'The return value of the sweepFilter function was not false or a Function', - [DjsErrorCodes.GuildForumMessageRequired]: 'You must provide a message to create a guild forum thread', + [ErrorCodes.GuildForumMessageRequired]: 'You must provide a message to create a guild forum thread', - [DjsErrorCodes.EntitlementCreateInvalidOwner]: + [ErrorCodes.EntitlementCreateInvalidOwner]: 'You must provide either a guild or a user to create an entitlement, but not both', - [DjsErrorCodes.BulkBanUsersOptionEmpty]: 'Option "users" array or collection is empty', + [ErrorCodes.BulkBanUsersOptionEmpty]: 'Option "users" array or collection is empty', - [DjsErrorCodes.PollAlreadyExpired]: 'This poll has already expired.', + [ErrorCodes.PollAlreadyExpired]: 'This poll has already expired.', }; -module.exports = Messages; +exports.Messages = Messages; diff --git a/packages/discord.js/src/errors/index.js b/packages/discord.js/src/errors/index.js index 78dc5c6ad2ac8..6aba6982ccf28 100644 --- a/packages/discord.js/src/errors/index.js +++ b/packages/discord.js/src/errors/index.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = require('./DJSError'); -module.exports.ErrorCodes = require('./ErrorCodes'); -module.exports.Messages = require('./Messages'); +exports.ErrorCodes = require('./ErrorCodes').ErrorCodes; +exports.Messages = require('./Messages').Messages; diff --git a/packages/discord.js/src/index.js b/packages/discord.js/src/index.js index d2f0ff7999477..99935da5da017 100644 --- a/packages/discord.js/src/index.js +++ b/packages/discord.js/src/index.js @@ -6,220 +6,235 @@ const { __exportStar } = require('tslib'); polyfillDispose(); // "Root" classes (starting points) -exports.BaseClient = require('./client/BaseClient'); -exports.Client = require('./client/Client'); -exports.Shard = require('./sharding/Shard'); -exports.ShardClientUtil = require('./sharding/ShardClientUtil'); -exports.ShardingManager = require('./sharding/ShardingManager'); -exports.WebhookClient = require('./client/WebhookClient'); +exports.BaseClient = require('./client/BaseClient').BaseClient; +exports.Client = require('./client/Client').Client; +exports.Shard = require('./sharding/Shard').Shard; +exports.ShardClientUtil = require('./sharding/ShardClientUtil').ShardClientUtil; +exports.ShardingManager = require('./sharding/ShardingManager').ShardingManager; +exports.WebhookClient = require('./client/WebhookClient').WebhookClient; // Errors exports.DiscordjsError = require('./errors/DJSError').DiscordjsError; exports.DiscordjsTypeError = require('./errors/DJSError').DiscordjsTypeError; exports.DiscordjsRangeError = require('./errors/DJSError').DiscordjsRangeError; -exports.DiscordjsErrorCodes = require('./errors/ErrorCodes'); +exports.DiscordjsErrorCodes = require('./errors/ErrorCodes').ErrorCodes; // Utilities -exports.ActivityFlagsBitField = require('./util/ActivityFlagsBitField'); -exports.ApplicationFlagsBitField = require('./util/ApplicationFlagsBitField'); -exports.AttachmentFlagsBitField = require('./util/AttachmentFlagsBitField'); -exports.BaseManager = require('./managers/BaseManager'); -exports.BitField = require('./util/BitField'); -exports.ChannelFlagsBitField = require('./util/ChannelFlagsBitField'); -exports.Collection = require('@discordjs/collection').Collection; +exports.ActivityFlagsBitField = require('./util/ActivityFlagsBitField').ActivityFlagsBitField; +exports.ApplicationFlagsBitField = require('./util/ApplicationFlagsBitField').ApplicationFlagsBitField; +exports.AttachmentFlagsBitField = require('./util/AttachmentFlagsBitField').AttachmentFlagsBitField; +exports.BaseManager = require('./managers/BaseManager').BaseManager; +exports.BitField = require('./util/BitField').BitField; +exports.ChannelFlagsBitField = require('./util/ChannelFlagsBitField').ChannelFlagsBitField; +exports.Collection = require('@discordjs/collection'); +exports.Colors = require('./util/Colors').Colors; exports.Constants = require('./util/Constants'); -exports.Colors = require('./util/Colors'); -__exportStar(require('./util/DataResolver.js'), exports); -exports.Events = require('./util/Events'); +exports.Events = require('./util/Events').Events; exports.GuildMemberFlagsBitField = require('./util/GuildMemberFlagsBitField').GuildMemberFlagsBitField; -exports.IntentsBitField = require('./util/IntentsBitField'); -exports.LimitedCollection = require('./util/LimitedCollection'); -exports.MessageFlagsBitField = require('./util/MessageFlagsBitField'); -exports.Options = require('./util/Options'); -exports.Partials = require('./util/Partials'); -exports.PermissionsBitField = require('./util/PermissionsBitField'); -exports.RoleFlagsBitField = require('./util/RoleFlagsBitField'); +exports.IntentsBitField = require('./util/IntentsBitField').IntentsBitField; +exports.LimitedCollection = require('./util/LimitedCollection').LimitedCollection; +exports.MessageFlagsBitField = require('./util/MessageFlagsBitField').MessageFlagsBitField; +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.SKUFlagsBitField = require('./util/SKUFlagsBitField').SKUFlagsBitField; -exports.Status = require('./util/Status'); exports.SnowflakeUtil = require('@sapphire/snowflake').DiscordSnowflake; -exports.Sweepers = require('./util/Sweepers'); -exports.SystemChannelFlagsBitField = require('./util/SystemChannelFlagsBitField'); -exports.ThreadMemberFlagsBitField = require('./util/ThreadMemberFlagsBitField'); -exports.UserFlagsBitField = require('./util/UserFlagsBitField'); +exports.Status = require('./util/Status').Status; +exports.Sweepers = require('./util/Sweepers').Sweepers; +exports.SystemChannelFlagsBitField = require('./util/SystemChannelFlagsBitField').SystemChannelFlagsBitField; +exports.ThreadMemberFlagsBitField = require('./util/ThreadMemberFlagsBitField').ThreadMemberFlagsBitField; +exports.UserFlagsBitField = require('./util/UserFlagsBitField').UserFlagsBitField; + +__exportStar(require('./util/DataResolver.js'), exports); __exportStar(require('./util/Util.js'), exports); + exports.version = require('../package.json').version; // Managers -exports.ApplicationCommandManager = require('./managers/ApplicationCommandManager'); -exports.ApplicationEmojiManager = require('./managers/ApplicationEmojiManager'); -exports.ApplicationCommandPermissionsManager = require('./managers/ApplicationCommandPermissionsManager'); -exports.AutoModerationRuleManager = require('./managers/AutoModerationRuleManager'); +exports.ApplicationCommandManager = require('./managers/ApplicationCommandManager').ApplicationCommandManager; +exports.ApplicationCommandPermissionsManager = + require('./managers/ApplicationCommandPermissionsManager').ApplicationCommandPermissionsManager; +exports.ApplicationEmojiManager = require('./managers/ApplicationEmojiManager').ApplicationEmojiManager; +exports.AutoModerationRuleManager = require('./managers/AutoModerationRuleManager').AutoModerationRuleManager; exports.BaseGuildEmojiManager = require('./managers/BaseGuildEmojiManager'); -exports.CachedManager = require('./managers/CachedManager'); -exports.ChannelManager = require('./managers/ChannelManager'); -exports.ClientVoiceManager = require('./client/voice/ClientVoiceManager'); -exports.DataManager = require('./managers/DataManager'); -exports.DMMessageManager = require('./managers/DMMessageManager'); +exports.CachedManager = require('./managers/CachedManager').CachedManager; +exports.ChannelManager = require('./managers/ChannelManager').ChannelManager; +exports.ClientVoiceManager = require('./client/voice/ClientVoiceManager').ClientVoiceManager; +exports.DataManager = require('./managers/DataManager').DataManager; +exports.DMMessageManager = require('./managers/DMMessageManager').DMMessageManager; exports.EntitlementManager = require('./managers/EntitlementManager').EntitlementManager; -exports.GuildApplicationCommandManager = require('./managers/GuildApplicationCommandManager'); -exports.GuildBanManager = require('./managers/GuildBanManager'); -exports.GuildChannelManager = require('./managers/GuildChannelManager'); -exports.GuildEmojiManager = require('./managers/GuildEmojiManager'); -exports.GuildEmojiRoleManager = require('./managers/GuildEmojiRoleManager'); -exports.GuildForumThreadManager = require('./managers/GuildForumThreadManager'); -exports.GuildInviteManager = require('./managers/GuildInviteManager'); -exports.GuildManager = require('./managers/GuildManager'); -exports.GuildMemberManager = require('./managers/GuildMemberManager'); -exports.GuildMemberRoleManager = require('./managers/GuildMemberRoleManager'); -exports.GuildMessageManager = require('./managers/GuildMessageManager'); -exports.GuildScheduledEventManager = require('./managers/GuildScheduledEventManager'); -exports.GuildStickerManager = require('./managers/GuildStickerManager'); -exports.GuildTextThreadManager = require('./managers/GuildTextThreadManager'); -exports.MessageManager = require('./managers/MessageManager'); -exports.PermissionOverwriteManager = require('./managers/PermissionOverwriteManager'); -exports.PresenceManager = require('./managers/PresenceManager'); -exports.ReactionManager = require('./managers/ReactionManager'); -exports.ReactionUserManager = require('./managers/ReactionUserManager'); -exports.RoleManager = require('./managers/RoleManager'); -exports.StageInstanceManager = require('./managers/StageInstanceManager'); +exports.GuildApplicationCommandManager = + require('./managers/GuildApplicationCommandManager').GuildApplicationCommandManager; +exports.GuildBanManager = require('./managers/GuildBanManager').GuildBanManager; +exports.GuildChannelManager = require('./managers/GuildChannelManager').GuildChannelManager; +exports.GuildEmojiManager = require('./managers/GuildEmojiManager').GuildEmojiManager; +exports.GuildEmojiRoleManager = require('./managers/GuildEmojiRoleManager').GuildEmojiRoleManager; +exports.GuildForumThreadManager = require('./managers/GuildForumThreadManager').GuildForumThreadManager; +exports.GuildInviteManager = require('./managers/GuildInviteManager').GuildInviteManager; +exports.GuildManager = require('./managers/GuildManager').GuildManager; +exports.GuildMemberManager = require('./managers/GuildMemberManager').GuildMemberManager; +exports.GuildMemberRoleManager = require('./managers/GuildMemberRoleManager').GuildMemberRoleManager; +exports.GuildMessageManager = require('./managers/GuildMessageManager').GuildMessageManager; +exports.GuildScheduledEventManager = require('./managers/GuildScheduledEventManager').GuildScheduledEventManager; +exports.GuildStickerManager = require('./managers/GuildStickerManager').GuildStickerManager; +exports.GuildTextThreadManager = require('./managers/GuildTextThreadManager').GuildTextThreadManager; +exports.MessageManager = require('./managers/MessageManager').MessageManager; +exports.PermissionOverwriteManager = require('./managers/PermissionOverwriteManager').PermissionOverwriteManager; +exports.PresenceManager = require('./managers/PresenceManager').PresenceManager; +exports.ReactionManager = require('./managers/ReactionManager').ReactionManager; +exports.ReactionUserManager = require('./managers/ReactionUserManager').ReactionUserManager; +exports.RoleManager = require('./managers/RoleManager').RoleManager; +exports.StageInstanceManager = require('./managers/StageInstanceManager').StageInstanceManager; exports.SubscriptionManager = require('./managers/SubscriptionManager').SubscriptionManager; -exports.ThreadManager = require('./managers/ThreadManager'); -exports.ThreadMemberManager = require('./managers/ThreadMemberManager'); -exports.UserManager = require('./managers/UserManager'); -exports.VoiceStateManager = require('./managers/VoiceStateManager'); +exports.ThreadManager = require('./managers/ThreadManager').ThreadManager; +exports.ThreadMemberManager = require('./managers/ThreadMemberManager').ThreadMemberManager; +exports.UserManager = require('./managers/UserManager').UserManager; +exports.VoiceStateManager = require('./managers/VoiceStateManager').VoiceStateManager; // Structures -exports.ActionRow = require('./structures/ActionRow'); -exports.ActionRowBuilder = require('./structures/ActionRowBuilder'); +exports.ActionRow = require('./structures/ActionRow').ActionRow; +exports.ActionRowBuilder = require('./structures/ActionRowBuilder').ActionRowBuilder; exports.Activity = require('./structures/Presence').Activity; -exports.AnonymousGuild = require('./structures/AnonymousGuild'); -exports.Application = require('./structures/interfaces/Application'); -exports.ApplicationCommand = require('./structures/ApplicationCommand'); -exports.ApplicationEmoji = require('./structures/ApplicationEmoji'); +exports.AnnouncementChannel = require('./structures/AnnouncementChannel.js').AnnouncementChannel; +exports.AnonymousGuild = require('./structures/AnonymousGuild').AnonymousGuild; +exports.Application = require('./structures/interfaces/Application').Application; +exports.ApplicationCommand = require('./structures/ApplicationCommand').ApplicationCommand; +exports.ApplicationEmoji = require('./structures/ApplicationEmoji').ApplicationEmoji; exports.ApplicationRoleConnectionMetadata = require('./structures/ApplicationRoleConnectionMetadata').ApplicationRoleConnectionMetadata; -exports.AutocompleteInteraction = require('./structures/AutocompleteInteraction'); -exports.AutoModerationActionExecution = require('./structures/AutoModerationActionExecution'); -exports.AutoModerationRule = require('./structures/AutoModerationRule'); -exports.Base = require('./structures/Base'); -exports.BaseGuild = require('./structures/BaseGuild'); -exports.BaseGuildEmoji = require('./structures/BaseGuildEmoji'); -exports.BaseGuildTextChannel = require('./structures/BaseGuildTextChannel'); -exports.BaseGuildVoiceChannel = require('./structures/BaseGuildVoiceChannel'); -exports.ButtonBuilder = require('./structures/ButtonBuilder'); -exports.ButtonComponent = require('./structures/ButtonComponent'); -exports.ButtonInteraction = require('./structures/ButtonInteraction'); -exports.CategoryChannel = require('./structures/CategoryChannel'); +exports.Attachment = require('./structures/Attachment').Attachment; +exports.AttachmentBuilder = require('./structures/AttachmentBuilder').AttachmentBuilder; +exports.AutocompleteInteraction = require('./structures/AutocompleteInteraction').AutocompleteInteraction; +exports.AutoModerationActionExecution = + require('./structures/AutoModerationActionExecution').AutoModerationActionExecution; +exports.AutoModerationRule = require('./structures/AutoModerationRule').AutoModerationRule; +exports.Base = require('./structures/Base').Base; exports.BaseChannel = require('./structures/BaseChannel').BaseChannel; -exports.ChatInputCommandInteraction = require('./structures/ChatInputCommandInteraction'); -exports.ClientApplication = require('./structures/ClientApplication'); -exports.ClientPresence = require('./structures/ClientPresence'); -exports.ClientUser = require('./structures/ClientUser'); -exports.CommandInteraction = require('./structures/CommandInteraction'); -exports.Collector = require('./structures/interfaces/Collector'); -exports.CommandInteractionOptionResolver = require('./structures/CommandInteractionOptionResolver'); -exports.Component = require('./structures/Component'); -exports.ContextMenuCommandInteraction = require('./structures/ContextMenuCommandInteraction'); -exports.DMChannel = require('./structures/DMChannel'); -exports.Embed = require('./structures/Embed'); -exports.EmbedBuilder = require('./structures/EmbedBuilder'); +exports.BaseGuild = require('./structures/BaseGuild').BaseGuild; +exports.BaseGuildEmoji = require('./structures/BaseGuildEmoji').BaseGuildEmoji; +exports.BaseGuildTextChannel = require('./structures/BaseGuildTextChannel').BaseGuildTextChannel; +exports.BaseGuildVoiceChannel = require('./structures/BaseGuildVoiceChannel').BaseGuildVoiceChannel; +exports.BaseInteraction = require('./structures/BaseInteraction').BaseInteraction; +exports.BaseSelectMenuComponent = require('./structures/BaseSelectMenuComponent').BaseSelectMenuComponent; +exports.ButtonBuilder = require('./structures/ButtonBuilder').ButtonBuilder; +exports.ButtonComponent = require('./structures/ButtonComponent').ButtonComponent; +exports.ButtonInteraction = require('./structures/ButtonInteraction').ButtonInteraction; +exports.CategoryChannel = require('./structures/CategoryChannel').CategoryChannel; +exports.ChannelSelectMenuBuilder = require('./structures/ChannelSelectMenuBuilder').ChannelSelectMenuBuilder; +exports.ChannelSelectMenuComponent = require('./structures/ChannelSelectMenuComponent').ChannelSelectMenuComponent; +exports.ChannelSelectMenuInteraction = + require('./structures/ChannelSelectMenuInteraction').ChannelSelectMenuInteraction; +exports.ChatInputCommandInteraction = require('./structures/ChatInputCommandInteraction').ChatInputCommandInteraction; +exports.ClientApplication = require('./structures/ClientApplication').ClientApplication; +exports.ClientPresence = require('./structures/ClientPresence').ClientPresence; +exports.ClientUser = require('./structures/ClientUser').ClientUser; +exports.Collector = require('./structures/interfaces/Collector').Collector; +exports.CommandInteraction = require('./structures/CommandInteraction').CommandInteraction; +exports.CommandInteractionOptionResolver = + require('./structures/CommandInteractionOptionResolver').CommandInteractionOptionResolver; +exports.Component = require('./structures/Component').Component; +exports.ContextMenuCommandInteraction = + require('./structures/ContextMenuCommandInteraction').ContextMenuCommandInteraction; +exports.DMChannel = require('./structures/DMChannel').DMChannel; +exports.Embed = require('./structures/Embed').Embed; +exports.EmbedBuilder = require('./structures/EmbedBuilder').EmbedBuilder; exports.Emoji = require('./structures/Emoji').Emoji; exports.Entitlement = require('./structures/Entitlement').Entitlement; -exports.ForumChannel = require('./structures/ForumChannel'); +exports.ForumChannel = require('./structures/ForumChannel').ForumChannel; exports.Guild = require('./structures/Guild').Guild; -exports.GuildAuditLogs = require('./structures/GuildAuditLogs'); -exports.GuildAuditLogsEntry = require('./structures/GuildAuditLogsEntry'); -exports.GuildBan = require('./structures/GuildBan'); -exports.GuildChannel = require('./structures/GuildChannel'); -exports.GuildEmoji = require('./structures/GuildEmoji'); +exports.GuildAuditLogs = require('./structures/GuildAuditLogs').GuildAuditLogs; +exports.GuildAuditLogsEntry = require('./structures/GuildAuditLogsEntry').GuildAuditLogsEntry; +exports.GuildBan = require('./structures/GuildBan').GuildBan; +exports.GuildChannel = require('./structures/GuildChannel').GuildChannel; +exports.GuildEmoji = require('./structures/GuildEmoji').GuildEmoji; exports.GuildMember = require('./structures/GuildMember').GuildMember; exports.GuildOnboarding = require('./structures/GuildOnboarding').GuildOnboarding; exports.GuildOnboardingPrompt = require('./structures/GuildOnboardingPrompt').GuildOnboardingPrompt; exports.GuildOnboardingPromptOption = require('./structures/GuildOnboardingPromptOption').GuildOnboardingPromptOption; -exports.GuildPreview = require('./structures/GuildPreview'); -exports.GuildPreviewEmoji = require('./structures/GuildPreviewEmoji'); +exports.GuildPreview = require('./structures/GuildPreview').GuildPreview; +exports.GuildPreviewEmoji = require('./structures/GuildPreviewEmoji').GuildPreviewEmoji; exports.GuildScheduledEvent = require('./structures/GuildScheduledEvent').GuildScheduledEvent; -exports.GuildTemplate = require('./structures/GuildTemplate'); -exports.Integration = require('./structures/Integration'); -exports.IntegrationApplication = require('./structures/IntegrationApplication'); -exports.InteractionCallback = require('./structures/InteractionCallback'); -exports.InteractionCallbackResource = require('./structures/InteractionCallbackResource'); -exports.InteractionCallbackResponse = require('./structures/InteractionCallbackResponse'); -exports.BaseInteraction = require('./structures/BaseInteraction'); -exports.InteractionCollector = require('./structures/InteractionCollector'); -exports.InteractionResponse = require('./structures/InteractionResponse'); -exports.InteractionWebhook = require('./structures/InteractionWebhook'); -exports.Invite = require('./structures/Invite'); -exports.InviteGuild = require('./structures/InviteGuild'); +exports.GuildTemplate = require('./structures/GuildTemplate').GuildTemplate; +exports.Integration = require('./structures/Integration').Integration; +exports.IntegrationApplication = require('./structures/IntegrationApplication').IntegrationApplication; +exports.InteractionCallback = require('./structures/InteractionCallback').InteractionCallback; +exports.InteractionCallbackResource = require('./structures/InteractionCallbackResource').InteractionCallbackResource; +exports.InteractionCallbackResponse = require('./structures/InteractionCallbackResponse').InteractionCallbackResponse; +exports.InteractionCollector = require('./structures/InteractionCollector').InteractionCollector; +exports.InteractionResponse = require('./structures/InteractionResponse').InteractionResponse; +exports.InteractionWebhook = require('./structures/InteractionWebhook').InteractionWebhook; +exports.Invite = require('./structures/Invite').Invite; +exports.InviteGuild = require('./structures/InviteGuild').InviteGuild; +exports.MediaChannel = require('./structures/MediaChannel').MediaChannel; +exports.MentionableSelectMenuBuilder = + require('./structures/MentionableSelectMenuBuilder').MentionableSelectMenuBuilder; +exports.MentionableSelectMenuComponent = + require('./structures/MentionableSelectMenuComponent').MentionableSelectMenuComponent; +exports.MentionableSelectMenuInteraction = + require('./structures/MentionableSelectMenuInteraction').MentionableSelectMenuInteraction; +exports.MentionableSelectMenuInteraction = + require('./structures/MentionableSelectMenuInteraction').MentionableSelectMenuInteraction; exports.Message = require('./structures/Message').Message; -exports.Attachment = require('./structures/Attachment'); -exports.AttachmentBuilder = require('./structures/AttachmentBuilder'); -exports.ModalBuilder = require('./structures/ModalBuilder'); -exports.MediaChannel = require('./structures/MediaChannel'); -exports.MessageCollector = require('./structures/MessageCollector'); -exports.MessageComponentInteraction = require('./structures/MessageComponentInteraction'); -exports.MessageContextMenuCommandInteraction = require('./structures/MessageContextMenuCommandInteraction'); -exports.MessageMentions = require('./structures/MessageMentions'); -exports.MessagePayload = require('./structures/MessagePayload'); -exports.MessageReaction = require('./structures/MessageReaction'); -exports.ModalSubmitInteraction = require('./structures/ModalSubmitInteraction'); -exports.ModalSubmitFields = require('./structures/ModalSubmitFields'); -exports.AnnouncementChannel = require('./structures/AnnouncementChannel.js'); -exports.OAuth2Guild = require('./structures/OAuth2Guild'); -exports.PartialGroupDMChannel = require('./structures/PartialGroupDMChannel'); -exports.PermissionOverwrites = require('./structures/PermissionOverwrites'); +exports.MessageCollector = require('./structures/MessageCollector').MessageCollector; +exports.MessageComponentInteraction = require('./structures/MessageComponentInteraction').MessageComponentInteraction; +exports.MessageContextMenuCommandInteraction = + require('./structures/MessageContextMenuCommandInteraction').MessageContextMenuCommandInteraction; +exports.MessageMentions = require('./structures/MessageMentions').MessageMentions; +exports.MessagePayload = require('./structures/MessagePayload').MessagePayload; +exports.MessageReaction = require('./structures/MessageReaction').MessageReaction; +exports.ModalBuilder = require('./structures/ModalBuilder').ModalBuilder; +exports.ModalSubmitFields = require('./structures/ModalSubmitFields').ModalSubmitFields; +exports.ModalSubmitInteraction = require('./structures/ModalSubmitInteraction').ModalSubmitInteraction; +exports.OAuth2Guild = require('./structures/OAuth2Guild').OAuth2Guild; +exports.PartialGroupDMChannel = require('./structures/PartialGroupDMChannel').PartialGroupDMChannel; +exports.PermissionOverwrites = require('./structures/PermissionOverwrites').PermissionOverwrites; exports.Poll = require('./structures/Poll').Poll; exports.PollAnswer = require('./structures/PollAnswer').PollAnswer; exports.Presence = require('./structures/Presence').Presence; -exports.ReactionCollector = require('./structures/ReactionCollector'); -exports.ReactionEmoji = require('./structures/ReactionEmoji'); +exports.ReactionCollector = require('./structures/ReactionCollector').ReactionCollector; +exports.ReactionEmoji = require('./structures/ReactionEmoji').ReactionEmoji; exports.RichPresenceAssets = require('./structures/Presence').RichPresenceAssets; exports.Role = require('./structures/Role').Role; -exports.ChannelSelectMenuBuilder = require('./structures/ChannelSelectMenuBuilder'); -exports.MentionableSelectMenuBuilder = require('./structures/MentionableSelectMenuBuilder'); -exports.RoleSelectMenuBuilder = require('./structures/RoleSelectMenuBuilder'); -exports.StringSelectMenuBuilder = require('./structures/StringSelectMenuBuilder'); -exports.UserSelectMenuBuilder = require('./structures/UserSelectMenuBuilder'); -exports.BaseSelectMenuComponent = require('./structures/BaseSelectMenuComponent'); -exports.ChannelSelectMenuComponent = require('./structures/ChannelSelectMenuComponent'); -exports.MentionableSelectMenuComponent = require('./structures/MentionableSelectMenuComponent'); -exports.RoleSelectMenuComponent = require('./structures/RoleSelectMenuComponent'); -exports.StringSelectMenuComponent = require('./structures/StringSelectMenuComponent'); -exports.UserSelectMenuComponent = require('./structures/UserSelectMenuComponent'); -exports.ChannelSelectMenuInteraction = require('./structures/ChannelSelectMenuInteraction'); -exports.MentionableSelectMenuInteraction = require('./structures/MentionableSelectMenuInteraction'); -exports.MentionableSelectMenuInteraction = require('./structures/MentionableSelectMenuInteraction'); -exports.RoleSelectMenuInteraction = require('./structures/RoleSelectMenuInteraction'); -exports.StringSelectMenuInteraction = require('./structures/StringSelectMenuInteraction'); -exports.UserSelectMenuInteraction = require('./structures/UserSelectMenuInteraction'); +exports.RoleSelectMenuBuilder = require('./structures/RoleSelectMenuBuilder').RoleSelectMenuBuilder; +exports.RoleSelectMenuComponent = require('./structures/RoleSelectMenuComponent').RoleSelectMenuComponent; +exports.RoleSelectMenuInteraction = require('./structures/RoleSelectMenuInteraction').RoleSelectMenuInteraction; exports.SKU = require('./structures/SKU').SKU; -exports.StringSelectMenuOptionBuilder = require('./structures/StringSelectMenuOptionBuilder'); -exports.StageChannel = require('./structures/StageChannel'); +exports.StageChannel = require('./structures/StageChannel').StageChannel; exports.StageInstance = require('./structures/StageInstance').StageInstance; -exports.Subscription = require('./structures/Subscription').Subscription; exports.Sticker = require('./structures/Sticker').Sticker; -exports.StickerPack = require('./structures/StickerPack'); -exports.Team = require('./structures/Team'); -exports.TeamMember = require('./structures/TeamMember'); -exports.TextChannel = require('./structures/TextChannel'); -exports.TextInputBuilder = require('./structures/TextInputBuilder'); -exports.TextInputComponent = require('./structures/TextInputComponent'); -exports.ThreadChannel = require('./structures/ThreadChannel'); -exports.ThreadMember = require('./structures/ThreadMember'); -exports.ThreadOnlyChannel = require('./structures/ThreadOnlyChannel'); -exports.Typing = require('./structures/Typing'); -exports.User = require('./structures/User'); -exports.UserContextMenuCommandInteraction = require('./structures/UserContextMenuCommandInteraction'); -exports.VoiceChannelEffect = require('./structures/VoiceChannelEffect'); -exports.VoiceChannel = require('./structures/VoiceChannel'); -exports.VoiceRegion = require('./structures/VoiceRegion'); -exports.VoiceState = require('./structures/VoiceState'); -exports.Webhook = require('./structures/Webhook'); -exports.Widget = require('./structures/Widget'); -exports.WidgetMember = require('./structures/WidgetMember'); -exports.WelcomeChannel = require('./structures/WelcomeChannel'); -exports.WelcomeScreen = require('./structures/WelcomeScreen'); +exports.StickerPack = require('./structures/StickerPack').StickerPack; +exports.StringSelectMenuBuilder = require('./structures/StringSelectMenuBuilder').StringSelectMenuBuilder; +exports.StringSelectMenuComponent = require('./structures/StringSelectMenuComponent').StringSelectMenuComponent; +exports.StringSelectMenuInteraction = require('./structures/StringSelectMenuInteraction').StringSelectMenuInteraction; +exports.StringSelectMenuOptionBuilder = + require('./structures/StringSelectMenuOptionBuilder').StringSelectMenuOptionBuilder; +exports.Subscription = require('./structures/Subscription').Subscription; +exports.Team = require('./structures/Team').Team; +exports.TeamMember = require('./structures/TeamMember').TeamMember; +exports.TextChannel = require('./structures/TextChannel').TextChannel; +exports.TextInputBuilder = require('./structures/TextInputBuilder').TextInputBuilder; +exports.TextInputComponent = require('./structures/TextInputComponent').TextInputComponent; +exports.ThreadChannel = require('./structures/ThreadChannel').ThreadChannel; +exports.ThreadMember = require('./structures/ThreadMember').ThreadMember; +exports.ThreadOnlyChannel = require('./structures/ThreadOnlyChannel').ThreadOnlyChannel; +exports.Typing = require('./structures/Typing').Typing; +exports.User = require('./structures/User').User; +exports.UserContextMenuCommandInteraction = + require('./structures/UserContextMenuCommandInteraction').UserContextMenuCommandInteraction; +exports.UserSelectMenuBuilder = require('./structures/UserSelectMenuBuilder').UserSelectMenuBuilder; +exports.UserSelectMenuComponent = require('./structures/UserSelectMenuComponent').UserSelectMenuComponent; +exports.UserSelectMenuInteraction = require('./structures/UserSelectMenuInteraction').UserSelectMenuInteraction; +exports.VoiceChannel = require('./structures/VoiceChannel').VoiceChannel; +exports.VoiceChannelEffect = require('./structures/VoiceChannelEffect').VoiceChannelEffect; +exports.VoiceRegion = require('./structures/VoiceRegion').VoiceRegion; +exports.VoiceState = require('./structures/VoiceState').VoiceState; +exports.Webhook = require('./structures/Webhook').Webhook; +exports.WelcomeChannel = require('./structures/WelcomeChannel').WelcomeChannel; +exports.WelcomeScreen = require('./structures/WelcomeScreen').WelcomeScreen; +exports.Widget = require('./structures/Widget').Widget; +exports.WidgetMember = require('./structures/WidgetMember').WidgetMember; // External __exportStar(require('discord-api-types/v10'), exports); diff --git a/packages/discord.js/src/managers/ApplicationCommandManager.js b/packages/discord.js/src/managers/ApplicationCommandManager.js index 8f6ce53106d4b..79714c1adbc39 100644 --- a/packages/discord.js/src/managers/ApplicationCommandManager.js +++ b/packages/discord.js/src/managers/ApplicationCommandManager.js @@ -4,11 +4,11 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { isJSONEncodable } = require('@discordjs/util'); const { Routes } = require('discord-api-types/v10'); -const ApplicationCommandPermissionsManager = require('./ApplicationCommandPermissionsManager'); -const CachedManager = require('./CachedManager'); +const { ApplicationCommandPermissionsManager } = require('./ApplicationCommandPermissionsManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const ApplicationCommand = require('../structures/ApplicationCommand'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { ApplicationCommand } = require('../structures/ApplicationCommand'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * Manages API methods for application commands and stores their cache. @@ -265,4 +265,4 @@ class ApplicationCommandManager extends CachedManager { } } -module.exports = ApplicationCommandManager; +exports.ApplicationCommandManager = ApplicationCommandManager; diff --git a/packages/discord.js/src/managers/ApplicationCommandPermissionsManager.js b/packages/discord.js/src/managers/ApplicationCommandPermissionsManager.js index c71b1e0844e5e..9e12f04da1ddf 100644 --- a/packages/discord.js/src/managers/ApplicationCommandPermissionsManager.js +++ b/packages/discord.js/src/managers/ApplicationCommandPermissionsManager.js @@ -2,7 +2,7 @@ const { Collection } = require('@discordjs/collection'); const { ApplicationCommandPermissionType, RESTJSONErrorCodes, Routes } = require('discord-api-types/v10'); -const BaseManager = require('./BaseManager'); +const { BaseManager } = require('./BaseManager'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); /** @@ -419,7 +419,7 @@ class ApplicationCommandPermissionsManager extends BaseManager { } } -module.exports = ApplicationCommandPermissionsManager; +exports.ApplicationCommandPermissionsManager = ApplicationCommandPermissionsManager; /* eslint-disable max-len */ /** diff --git a/packages/discord.js/src/managers/ApplicationEmojiManager.js b/packages/discord.js/src/managers/ApplicationEmojiManager.js index d53ee2fb1abc1..eddd815f44787 100644 --- a/packages/discord.js/src/managers/ApplicationEmojiManager.js +++ b/packages/discord.js/src/managers/ApplicationEmojiManager.js @@ -2,9 +2,9 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const ApplicationEmoji = require('../structures/ApplicationEmoji'); +const { ApplicationEmoji } = require('../structures/ApplicationEmoji'); const { resolveImage } = require('../util/DataResolver'); /** @@ -139,4 +139,4 @@ class ApplicationEmojiManager extends CachedManager { } } -module.exports = ApplicationEmojiManager; +exports.ApplicationEmojiManager = ApplicationEmojiManager; diff --git a/packages/discord.js/src/managers/AutoModerationRuleManager.js b/packages/discord.js/src/managers/AutoModerationRuleManager.js index 4e53ae964e80b..43793441bd58b 100644 --- a/packages/discord.js/src/managers/AutoModerationRuleManager.js +++ b/packages/discord.js/src/managers/AutoModerationRuleManager.js @@ -2,8 +2,8 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); -const AutoModerationRule = require('../structures/AutoModerationRule'); +const { CachedManager } = require('./CachedManager'); +const { AutoModerationRule } = require('../structures/AutoModerationRule'); /** * Manages API methods for auto moderation rules and stores their cache. @@ -289,4 +289,4 @@ class AutoModerationRuleManager extends CachedManager { } } -module.exports = AutoModerationRuleManager; +exports.AutoModerationRuleManager = AutoModerationRuleManager; diff --git a/packages/discord.js/src/managers/BaseGuildEmojiManager.js b/packages/discord.js/src/managers/BaseGuildEmojiManager.js index fd02b13e4d61d..155569923dd61 100644 --- a/packages/discord.js/src/managers/BaseGuildEmojiManager.js +++ b/packages/discord.js/src/managers/BaseGuildEmojiManager.js @@ -1,9 +1,9 @@ 'use strict'; -const CachedManager = require('./CachedManager'); -const ApplicationEmoji = require('../structures/ApplicationEmoji'); -const GuildEmoji = require('../structures/GuildEmoji'); -const ReactionEmoji = require('../structures/ReactionEmoji'); +const { CachedManager } = require('./CachedManager'); +const { ApplicationEmoji } = require('../structures/ApplicationEmoji'); +const { GuildEmoji } = require('../structures/GuildEmoji'); +const { ReactionEmoji } = require('../structures/ReactionEmoji'); const { parseEmoji } = require('../util/Util'); /** @@ -82,4 +82,4 @@ class BaseGuildEmojiManager extends CachedManager { } } -module.exports = BaseGuildEmojiManager; +exports.BaseGuildEmojiManager = BaseGuildEmojiManager; diff --git a/packages/discord.js/src/managers/BaseManager.js b/packages/discord.js/src/managers/BaseManager.js index 06514011a1a1c..fe6756c49b4f3 100644 --- a/packages/discord.js/src/managers/BaseManager.js +++ b/packages/discord.js/src/managers/BaseManager.js @@ -16,4 +16,4 @@ class BaseManager { } } -module.exports = BaseManager; +exports.BaseManager = BaseManager; diff --git a/packages/discord.js/src/managers/CachedManager.js b/packages/discord.js/src/managers/CachedManager.js index b4c50b1b324d0..5dd90311abc1d 100644 --- a/packages/discord.js/src/managers/CachedManager.js +++ b/packages/discord.js/src/managers/CachedManager.js @@ -1,6 +1,6 @@ 'use strict'; -const DataManager = require('./DataManager'); +const { DataManager } = require('./DataManager'); const { MakeCacheOverrideSymbol } = require('../util/Symbols'); /** @@ -61,4 +61,4 @@ class CachedManager extends DataManager { } } -module.exports = CachedManager; +exports.CachedManager = CachedManager; diff --git a/packages/discord.js/src/managers/CategoryChannelChildManager.js b/packages/discord.js/src/managers/CategoryChannelChildManager.js index 8961c479c94f4..6c3907118f4a1 100644 --- a/packages/discord.js/src/managers/CategoryChannelChildManager.js +++ b/packages/discord.js/src/managers/CategoryChannelChildManager.js @@ -1,7 +1,7 @@ 'use strict'; -const DataManager = require('./DataManager'); -const GuildChannel = require('../structures/GuildChannel'); +const { DataManager } = require('./DataManager'); +const { GuildChannel } = require('../structures/GuildChannel'); /** * Manages API methods for CategoryChannels' children. @@ -76,4 +76,4 @@ class CategoryChannelChildManager extends DataManager { } } -module.exports = CategoryChannelChildManager; +exports.CategoryChannelChildManager = CategoryChannelChildManager; diff --git a/packages/discord.js/src/managers/ChannelManager.js b/packages/discord.js/src/managers/ChannelManager.js index 0126d914467d5..529ca87f332db 100644 --- a/packages/discord.js/src/managers/ChannelManager.js +++ b/packages/discord.js/src/managers/ChannelManager.js @@ -2,11 +2,11 @@ const process = require('node:process'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { BaseChannel } = require('../structures/BaseChannel'); const { createChannel } = require('../util/Channels'); const { ThreadChannelTypes } = require('../util/Constants'); -const Events = require('../util/Events'); +const { Events } = require('../util/Events'); let cacheWarningEmitted = false; @@ -125,4 +125,4 @@ class ChannelManager extends CachedManager { } } -module.exports = ChannelManager; +exports.ChannelManager = ChannelManager; diff --git a/packages/discord.js/src/managers/DMMessageManager.js b/packages/discord.js/src/managers/DMMessageManager.js index f0b3a338c92e3..d7ad610501886 100644 --- a/packages/discord.js/src/managers/DMMessageManager.js +++ b/packages/discord.js/src/managers/DMMessageManager.js @@ -1,6 +1,6 @@ 'use strict'; -const MessageManager = require('./MessageManager'); +const { MessageManager } = require('./MessageManager'); /** * Manages API methods for messages in direct message channels and holds their cache. @@ -14,4 +14,4 @@ class DMMessageManager extends MessageManager { */ } -module.exports = DMMessageManager; +exports.DMMessageManager = DMMessageManager; diff --git a/packages/discord.js/src/managers/DataManager.js b/packages/discord.js/src/managers/DataManager.js index 383844e29a714..88e7b9441ede0 100644 --- a/packages/discord.js/src/managers/DataManager.js +++ b/packages/discord.js/src/managers/DataManager.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseManager = require('./BaseManager'); +const { BaseManager } = require('./BaseManager'); const { DiscordjsError, ErrorCodes } = require('../errors'); /** @@ -58,4 +58,4 @@ class DataManager extends BaseManager { } } -module.exports = DataManager; +exports.DataManager = DataManager; diff --git a/packages/discord.js/src/managers/EntitlementManager.js b/packages/discord.js/src/managers/EntitlementManager.js index 1456d3719acb3..c69fd7d0081c3 100644 --- a/packages/discord.js/src/managers/EntitlementManager.js +++ b/packages/discord.js/src/managers/EntitlementManager.js @@ -3,7 +3,7 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes, EntitlementOwnerType } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { ErrorCodes, DiscordjsTypeError } = require('../errors/index'); const { Entitlement } = require('../structures/Entitlement'); const { resolveSKUId } = require('../util/Util'); diff --git a/packages/discord.js/src/managers/GuildApplicationCommandManager.js b/packages/discord.js/src/managers/GuildApplicationCommandManager.js index 97fea5e45bddd..65a508486499c 100644 --- a/packages/discord.js/src/managers/GuildApplicationCommandManager.js +++ b/packages/discord.js/src/managers/GuildApplicationCommandManager.js @@ -1,7 +1,7 @@ 'use strict'; -const ApplicationCommandManager = require('./ApplicationCommandManager'); -const ApplicationCommandPermissionsManager = require('./ApplicationCommandPermissionsManager'); +const { ApplicationCommandManager } = require('./ApplicationCommandManager'); +const { ApplicationCommandPermissionsManager } = require('./ApplicationCommandPermissionsManager'); /** * An extension for guild-specific application commands. @@ -25,4 +25,4 @@ class GuildApplicationCommandManager extends ApplicationCommandManager { } } -module.exports = GuildApplicationCommandManager; +exports.GuildApplicationCommandManager = GuildApplicationCommandManager; diff --git a/packages/discord.js/src/managers/GuildBanManager.js b/packages/discord.js/src/managers/GuildBanManager.js index 3838179d57a94..ad6c50e38404e 100644 --- a/packages/discord.js/src/managers/GuildBanManager.js +++ b/packages/discord.js/src/managers/GuildBanManager.js @@ -3,9 +3,9 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, DiscordjsError, ErrorCodes } = require('../errors'); -const GuildBan = require('../structures/GuildBan'); +const { GuildBan } = require('../structures/GuildBan'); const { GuildMember } = require('../structures/GuildMember'); /** @@ -221,4 +221,4 @@ class GuildBanManager extends CachedManager { } } -module.exports = GuildBanManager; +exports.GuildBanManager = GuildBanManager; diff --git a/packages/discord.js/src/managers/GuildChannelManager.js b/packages/discord.js/src/managers/GuildChannelManager.js index 99405be03c3f1..0468999e55357 100644 --- a/packages/discord.js/src/managers/GuildChannelManager.js +++ b/packages/discord.js/src/managers/GuildChannelManager.js @@ -3,14 +3,14 @@ const process = require('node:process'); const { Collection } = require('@discordjs/collection'); const { ChannelType, Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); -const GuildTextThreadManager = require('./GuildTextThreadManager'); +const { CachedManager } = require('./CachedManager'); +const { GuildTextThreadManager } = require('./GuildTextThreadManager'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); -const GuildChannel = require('../structures/GuildChannel'); -const PermissionOverwrites = require('../structures/PermissionOverwrites'); -const ThreadChannel = require('../structures/ThreadChannel'); -const Webhook = require('../structures/Webhook'); -const ChannelFlagsBitField = require('../util/ChannelFlagsBitField'); +const { GuildChannel } = require('../structures/GuildChannel'); +const { PermissionOverwrites } = require('../structures/PermissionOverwrites'); +const { ThreadChannel } = require('../structures/ThreadChannel'); +const { Webhook } = require('../structures/Webhook'); +const { ChannelFlagsBitField } = require('../util/ChannelFlagsBitField'); const { transformGuildForumTag, transformGuildDefaultReaction } = require('../util/Channels'); const { ThreadChannelTypes } = require('../util/Constants'); const { resolveImage } = require('../util/DataResolver'); @@ -516,4 +516,4 @@ class GuildChannelManager extends CachedManager { } } -module.exports = GuildChannelManager; +exports.GuildChannelManager = GuildChannelManager; diff --git a/packages/discord.js/src/managers/GuildEmojiManager.js b/packages/discord.js/src/managers/GuildEmojiManager.js index e5911840ecb92..1389664de8644 100644 --- a/packages/discord.js/src/managers/GuildEmojiManager.js +++ b/packages/discord.js/src/managers/GuildEmojiManager.js @@ -2,7 +2,7 @@ const { Collection } = require('@discordjs/collection'); const { Routes, PermissionFlagsBits } = require('discord-api-types/v10'); -const BaseGuildEmojiManager = require('./BaseGuildEmojiManager'); +const { BaseGuildEmojiManager } = require('./BaseGuildEmojiManager'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); const { resolveImage } = require('../util/DataResolver'); @@ -171,4 +171,4 @@ class GuildEmojiManager extends BaseGuildEmojiManager { } } -module.exports = GuildEmojiManager; +exports.GuildEmojiManager = GuildEmojiManager; diff --git a/packages/discord.js/src/managers/GuildEmojiRoleManager.js b/packages/discord.js/src/managers/GuildEmojiRoleManager.js index 7b97f41d298bd..99ec8bb8e1c14 100644 --- a/packages/discord.js/src/managers/GuildEmojiRoleManager.js +++ b/packages/discord.js/src/managers/GuildEmojiRoleManager.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const DataManager = require('./DataManager'); +const { DataManager } = require('./DataManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); const { Role } = require('../structures/Role'); @@ -115,4 +115,4 @@ class GuildEmojiRoleManager extends DataManager { } } -module.exports = GuildEmojiRoleManager; +exports.GuildEmojiRoleManager = GuildEmojiRoleManager; diff --git a/packages/discord.js/src/managers/GuildForumThreadManager.js b/packages/discord.js/src/managers/GuildForumThreadManager.js index f830b98f1a7e1..d23ce5384f0cc 100644 --- a/packages/discord.js/src/managers/GuildForumThreadManager.js +++ b/packages/discord.js/src/managers/GuildForumThreadManager.js @@ -1,9 +1,9 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const ThreadManager = require('./ThreadManager'); +const { ThreadManager } = require('./ThreadManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const MessagePayload = require('../structures/MessagePayload'); +const { MessagePayload } = require('../structures/MessagePayload'); /** * Manages API methods for threads in forum channels and stores their cache. @@ -80,4 +80,4 @@ class GuildForumThreadManager extends ThreadManager { } } -module.exports = GuildForumThreadManager; +exports.GuildForumThreadManager = GuildForumThreadManager; diff --git a/packages/discord.js/src/managers/GuildInviteManager.js b/packages/discord.js/src/managers/GuildInviteManager.js index 641cf53ff8a8a..411baa03fc972 100644 --- a/packages/discord.js/src/managers/GuildInviteManager.js +++ b/packages/discord.js/src/managers/GuildInviteManager.js @@ -2,9 +2,9 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const Invite = require('../structures/Invite'); +const { Invite } = require('../structures/Invite'); const { resolveInviteCode } = require('../util/DataResolver'); /** @@ -212,4 +212,4 @@ class GuildInviteManager extends CachedManager { } } -module.exports = GuildInviteManager; +exports.GuildInviteManager = GuildInviteManager; diff --git a/packages/discord.js/src/managers/GuildManager.js b/packages/discord.js/src/managers/GuildManager.js index e02cd5e82e1ac..f37c744f61bbf 100644 --- a/packages/discord.js/src/managers/GuildManager.js +++ b/packages/discord.js/src/managers/GuildManager.js @@ -5,19 +5,19 @@ const { setTimeout, clearTimeout } = require('node:timers'); const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes, RouteBases } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); -const ShardClientUtil = require('../sharding/ShardClientUtil'); +const { CachedManager } = require('./CachedManager'); +const { ShardClientUtil } = require('../sharding/ShardClientUtil'); const { Guild } = require('../structures/Guild'); -const GuildChannel = require('../structures/GuildChannel'); -const GuildEmoji = require('../structures/GuildEmoji'); +const { GuildChannel } = require('../structures/GuildChannel'); +const { GuildEmoji } = require('../structures/GuildEmoji'); const { GuildMember } = require('../structures/GuildMember'); -const Invite = require('../structures/Invite'); -const OAuth2Guild = require('../structures/OAuth2Guild'); +const { Invite } = require('../structures/Invite'); +const { OAuth2Guild } = require('../structures/OAuth2Guild'); const { Role } = require('../structures/Role'); const { resolveImage } = require('../util/DataResolver'); -const Events = require('../util/Events'); -const PermissionsBitField = require('../util/PermissionsBitField'); -const SystemChannelFlagsBitField = require('../util/SystemChannelFlagsBitField'); +const { Events } = require('../util/Events'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); +const { SystemChannelFlagsBitField } = require('../util/SystemChannelFlagsBitField'); const { resolveColor } = require('../util/Util'); let cacheWarningEmitted = false; @@ -296,4 +296,4 @@ class GuildManager extends CachedManager { } } -module.exports = GuildManager; +exports.GuildManager = GuildManager; diff --git a/packages/discord.js/src/managers/GuildMemberManager.js b/packages/discord.js/src/managers/GuildMemberManager.js index 0934ff640f5cc..27f449cc41d8d 100644 --- a/packages/discord.js/src/managers/GuildMemberManager.js +++ b/packages/discord.js/src/managers/GuildMemberManager.js @@ -5,14 +5,14 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { Routes, GatewayOpcodes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsError, DiscordjsTypeError, DiscordjsRangeError, ErrorCodes } = require('../errors'); -const BaseGuildVoiceChannel = require('../structures/BaseGuildVoiceChannel'); +const { BaseGuildVoiceChannel } = require('../structures/BaseGuildVoiceChannel'); const { GuildMember } = require('../structures/GuildMember'); const { Role } = require('../structures/Role'); -const Events = require('../util/Events'); +const { Events } = require('../util/Events'); const { GuildMemberFlagsBitField } = require('../util/GuildMemberFlagsBitField'); -const Partials = require('../util/Partials'); +const { Partials } = require('../util/Partials'); /** * Manages API methods for GuildMembers and stores their cache. @@ -557,4 +557,4 @@ class GuildMemberManager extends CachedManager { } } -module.exports = GuildMemberManager; +exports.GuildMemberManager = GuildMemberManager; diff --git a/packages/discord.js/src/managers/GuildMemberRoleManager.js b/packages/discord.js/src/managers/GuildMemberRoleManager.js index 7d19bf778b64d..38d9fb5cb7acb 100644 --- a/packages/discord.js/src/managers/GuildMemberRoleManager.js +++ b/packages/discord.js/src/managers/GuildMemberRoleManager.js @@ -2,7 +2,7 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const DataManager = require('./DataManager'); +const { DataManager } = require('./DataManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); const { Role } = require('../structures/Role'); @@ -205,4 +205,4 @@ class GuildMemberRoleManager extends DataManager { } } -module.exports = GuildMemberRoleManager; +exports.GuildMemberRoleManager = GuildMemberRoleManager; diff --git a/packages/discord.js/src/managers/GuildMessageManager.js b/packages/discord.js/src/managers/GuildMessageManager.js index 7a93c99f1ed27..869844b957759 100644 --- a/packages/discord.js/src/managers/GuildMessageManager.js +++ b/packages/discord.js/src/managers/GuildMessageManager.js @@ -1,6 +1,6 @@ 'use strict'; -const MessageManager = require('./MessageManager'); +const { MessageManager } = require('./MessageManager'); /** * Manages API methods for messages in a guild and holds their cache. @@ -14,4 +14,4 @@ class GuildMessageManager extends MessageManager { */ } -module.exports = GuildMessageManager; +exports.GuildMessageManager = GuildMessageManager; diff --git a/packages/discord.js/src/managers/GuildScheduledEventManager.js b/packages/discord.js/src/managers/GuildScheduledEventManager.js index 02e14c06259b1..83ef8c738e3b1 100644 --- a/packages/discord.js/src/managers/GuildScheduledEventManager.js +++ b/packages/discord.js/src/managers/GuildScheduledEventManager.js @@ -3,7 +3,7 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { GuildScheduledEventEntityType, Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, DiscordjsError, ErrorCodes } = require('../errors'); const { GuildScheduledEvent } = require('../structures/GuildScheduledEvent'); const { resolveImage } = require('../util/DataResolver'); @@ -315,4 +315,4 @@ class GuildScheduledEventManager extends CachedManager { } } -module.exports = GuildScheduledEventManager; +exports.GuildScheduledEventManager = GuildScheduledEventManager; diff --git a/packages/discord.js/src/managers/GuildStickerManager.js b/packages/discord.js/src/managers/GuildStickerManager.js index a4974ecd72360..17996336b02e8 100644 --- a/packages/discord.js/src/managers/GuildStickerManager.js +++ b/packages/discord.js/src/managers/GuildStickerManager.js @@ -2,9 +2,9 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const MessagePayload = require('../structures/MessagePayload'); +const { MessagePayload } = require('../structures/MessagePayload'); const { Sticker } = require('../structures/Sticker'); /** @@ -179,4 +179,4 @@ class GuildStickerManager extends CachedManager { } } -module.exports = GuildStickerManager; +exports.GuildStickerManager = GuildStickerManager; diff --git a/packages/discord.js/src/managers/GuildTextThreadManager.js b/packages/discord.js/src/managers/GuildTextThreadManager.js index 84c6a341997d4..5ca50ffa5ac1d 100644 --- a/packages/discord.js/src/managers/GuildTextThreadManager.js +++ b/packages/discord.js/src/managers/GuildTextThreadManager.js @@ -1,7 +1,7 @@ 'use strict'; const { ChannelType, Routes } = require('discord-api-types/v10'); -const ThreadManager = require('./ThreadManager'); +const { ThreadManager } = require('./ThreadManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); /** @@ -88,4 +88,4 @@ class GuildTextThreadManager extends ThreadManager { } } -module.exports = GuildTextThreadManager; +exports.GuildTextThreadManager = GuildTextThreadManager; diff --git a/packages/discord.js/src/managers/MessageManager.js b/packages/discord.js/src/managers/MessageManager.js index dcddf28573836..dc27aecc403dd 100644 --- a/packages/discord.js/src/managers/MessageManager.js +++ b/packages/discord.js/src/managers/MessageManager.js @@ -3,10 +3,10 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); const { Message } = require('../structures/Message'); -const MessagePayload = require('../structures/MessagePayload'); +const { MessagePayload } = require('../structures/MessagePayload'); const { MakeCacheOverrideSymbol } = require('../util/Symbols'); const { resolvePartialEmoji } = require('../util/Util'); @@ -298,4 +298,4 @@ class MessageManager extends CachedManager { } } -module.exports = MessageManager; +exports.MessageManager = MessageManager; diff --git a/packages/discord.js/src/managers/PartialGroupDMMessageManager.js b/packages/discord.js/src/managers/PartialGroupDMMessageManager.js index b30abe733f3b3..d3def5586e6e5 100644 --- a/packages/discord.js/src/managers/PartialGroupDMMessageManager.js +++ b/packages/discord.js/src/managers/PartialGroupDMMessageManager.js @@ -1,6 +1,6 @@ 'use strict'; -const MessageManager = require('./MessageManager'); +const { MessageManager } = require('./MessageManager'); /** * Manages API methods for messages in group direct message channels and holds their cache. @@ -14,4 +14,4 @@ class PartialGroupDMMessageManager extends MessageManager { */ } -module.exports = PartialGroupDMMessageManager; +exports.PartialGroupDMMessageManager = PartialGroupDMMessageManager; diff --git a/packages/discord.js/src/managers/PermissionOverwriteManager.js b/packages/discord.js/src/managers/PermissionOverwriteManager.js index 9ab8d3abf58a6..8d6af1bdb2a20 100644 --- a/packages/discord.js/src/managers/PermissionOverwriteManager.js +++ b/packages/discord.js/src/managers/PermissionOverwriteManager.js @@ -3,9 +3,9 @@ const process = require('node:process'); const { Collection } = require('@discordjs/collection'); const { OverwriteType, Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const PermissionOverwrites = require('../structures/PermissionOverwrites'); +const { PermissionOverwrites } = require('../structures/PermissionOverwrites'); const { Role } = require('../structures/Role'); let cacheWarningEmitted = false; @@ -165,4 +165,4 @@ class PermissionOverwriteManager extends CachedManager { } } -module.exports = PermissionOverwriteManager; +exports.PermissionOverwriteManager = PermissionOverwriteManager; diff --git a/packages/discord.js/src/managers/PresenceManager.js b/packages/discord.js/src/managers/PresenceManager.js index 2ea0667b64986..0e8cb7ba1a022 100644 --- a/packages/discord.js/src/managers/PresenceManager.js +++ b/packages/discord.js/src/managers/PresenceManager.js @@ -1,6 +1,6 @@ 'use strict'; -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { Presence } = require('../structures/Presence'); /** @@ -55,4 +55,4 @@ class PresenceManager extends CachedManager { } } -module.exports = PresenceManager; +exports.PresenceManager = PresenceManager; diff --git a/packages/discord.js/src/managers/ReactionManager.js b/packages/discord.js/src/managers/ReactionManager.js index 55358829ba0d4..814806d29f976 100644 --- a/packages/discord.js/src/managers/ReactionManager.js +++ b/packages/discord.js/src/managers/ReactionManager.js @@ -1,8 +1,8 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); -const MessageReaction = require('../structures/MessageReaction'); +const { CachedManager } = require('./CachedManager'); +const { MessageReaction } = require('../structures/MessageReaction'); /** * Manages API methods for reactions and holds their cache. @@ -65,4 +65,4 @@ class ReactionManager extends CachedManager { } } -module.exports = ReactionManager; +exports.ReactionManager = ReactionManager; diff --git a/packages/discord.js/src/managers/ReactionUserManager.js b/packages/discord.js/src/managers/ReactionUserManager.js index c9a88be617be1..1bb5a3a6ebc79 100644 --- a/packages/discord.js/src/managers/ReactionUserManager.js +++ b/packages/discord.js/src/managers/ReactionUserManager.js @@ -3,9 +3,9 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { ReactionType, Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const User = require('../structures/User'); +const { User } = require('../structures/User'); /** * Manages API methods for users who reacted to a reaction and stores their cache. @@ -75,4 +75,4 @@ class ReactionUserManager extends CachedManager { } } -module.exports = ReactionUserManager; +exports.ReactionUserManager = ReactionUserManager; diff --git a/packages/discord.js/src/managers/RoleManager.js b/packages/discord.js/src/managers/RoleManager.js index a44363a92b4c0..ae2d49efa2598 100644 --- a/packages/discord.js/src/managers/RoleManager.js +++ b/packages/discord.js/src/managers/RoleManager.js @@ -3,11 +3,11 @@ const process = require('node:process'); const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); const { Role } = require('../structures/Role'); const { resolveImage } = require('../util/DataResolver'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); const { setPosition, resolveColor } = require('../util/Util'); let cacheWarningEmitted = false; @@ -361,4 +361,4 @@ class RoleManager extends CachedManager { } } -module.exports = RoleManager; +exports.RoleManager = RoleManager; diff --git a/packages/discord.js/src/managers/StageInstanceManager.js b/packages/discord.js/src/managers/StageInstanceManager.js index 2f78b12f0c170..a59fea8634c9e 100644 --- a/packages/discord.js/src/managers/StageInstanceManager.js +++ b/packages/discord.js/src/managers/StageInstanceManager.js @@ -1,7 +1,7 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, DiscordjsError, ErrorCodes } = require('../errors'); const { StageInstance } = require('../structures/StageInstance'); @@ -156,4 +156,4 @@ class StageInstanceManager extends CachedManager { } } -module.exports = StageInstanceManager; +exports.StageInstanceManager = StageInstanceManager; diff --git a/packages/discord.js/src/managers/SubscriptionManager.js b/packages/discord.js/src/managers/SubscriptionManager.js index 05f541df8b6ff..6c6a2d9a193eb 100644 --- a/packages/discord.js/src/managers/SubscriptionManager.js +++ b/packages/discord.js/src/managers/SubscriptionManager.js @@ -3,7 +3,7 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors/index'); const { Subscription } = require('../structures/Subscription'); const { resolveSKUId } = require('../util/Util'); diff --git a/packages/discord.js/src/managers/ThreadManager.js b/packages/discord.js/src/managers/ThreadManager.js index afb75a1e0b7ac..62fd71798320b 100644 --- a/packages/discord.js/src/managers/ThreadManager.js +++ b/packages/discord.js/src/managers/ThreadManager.js @@ -3,9 +3,9 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const ThreadChannel = require('../structures/ThreadChannel'); +const { ThreadChannel } = require('../structures/ThreadChannel'); const { MakeCacheOverrideSymbol } = require('../util/Symbols'); /** @@ -195,4 +195,4 @@ class ThreadManager extends CachedManager { } } -module.exports = ThreadManager; +exports.ThreadManager = ThreadManager; diff --git a/packages/discord.js/src/managers/ThreadMemberManager.js b/packages/discord.js/src/managers/ThreadMemberManager.js index 4cc42e293f727..7b8c5f3e1d9f9 100644 --- a/packages/discord.js/src/managers/ThreadMemberManager.js +++ b/packages/discord.js/src/managers/ThreadMemberManager.js @@ -3,9 +3,9 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const ThreadMember = require('../structures/ThreadMember'); +const { ThreadMember } = require('../structures/ThreadMember'); /** * Manages API methods for GuildMembers and stores their cache. @@ -179,4 +179,4 @@ class ThreadMemberManager extends CachedManager { } } -module.exports = ThreadMemberManager; +exports.ThreadMemberManager = ThreadMemberManager; diff --git a/packages/discord.js/src/managers/UserManager.js b/packages/discord.js/src/managers/UserManager.js index b0026da2c69a7..50f48e418c700 100644 --- a/packages/discord.js/src/managers/UserManager.js +++ b/packages/discord.js/src/managers/UserManager.js @@ -1,12 +1,12 @@ 'use strict'; const { ChannelType, Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); +const { CachedManager } = require('./CachedManager'); const { DiscordjsError, ErrorCodes } = require('../errors'); const { GuildMember } = require('../structures/GuildMember'); const { Message } = require('../structures/Message'); -const ThreadMember = require('../structures/ThreadMember'); -const User = require('../structures/User'); +const { ThreadMember } = require('../structures/ThreadMember'); +const { User } = require('../structures/User'); /** * Manages API methods for users and stores their cache. @@ -129,4 +129,4 @@ class UserManager extends CachedManager { } } -module.exports = UserManager; +exports.UserManager = UserManager; diff --git a/packages/discord.js/src/managers/VoiceStateManager.js b/packages/discord.js/src/managers/VoiceStateManager.js index 586bd5ad9e08c..95e54465a353a 100644 --- a/packages/discord.js/src/managers/VoiceStateManager.js +++ b/packages/discord.js/src/managers/VoiceStateManager.js @@ -1,8 +1,8 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const CachedManager = require('./CachedManager'); -const VoiceState = require('../structures/VoiceState'); +const { CachedManager } = require('./CachedManager'); +const { VoiceState } = require('../structures/VoiceState'); /** * Manages API methods for VoiceStates and stores their cache. @@ -56,4 +56,4 @@ class VoiceStateManager extends CachedManager { } } -module.exports = VoiceStateManager; +exports.VoiceStateManager = VoiceStateManager; diff --git a/packages/discord.js/src/sharding/Shard.js b/packages/discord.js/src/sharding/Shard.js index da1d57b59e501..0d52f3aadf718 100644 --- a/packages/discord.js/src/sharding/Shard.js +++ b/packages/discord.js/src/sharding/Shard.js @@ -7,7 +7,7 @@ const { setTimeout, clearTimeout } = require('node:timers'); const { setTimeout: sleep } = require('node:timers/promises'); const { SHARE_ENV } = require('node:worker_threads'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const ShardEvents = require('../util/ShardEvents'); +const { ShardEvents } = require('../util/ShardEvents'); const { makeError, makePlainError } = require('../util/Util'); let childProcess = null; @@ -468,4 +468,4 @@ class Shard extends EventEmitter { } } -module.exports = Shard; +exports.Shard = Shard; diff --git a/packages/discord.js/src/sharding/ShardClientUtil.js b/packages/discord.js/src/sharding/ShardClientUtil.js index 7949068fc5d33..5aa5bc6698f7e 100644 --- a/packages/discord.js/src/sharding/ShardClientUtil.js +++ b/packages/discord.js/src/sharding/ShardClientUtil.js @@ -4,7 +4,7 @@ const process = require('node:process'); const { calculateShardId } = require('@discordjs/util'); const { WebSocketShardEvents } = require('@discordjs/ws'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); -const Events = require('../util/Events'); +const { Events } = require('../util/Events'); const { makeError, makePlainError } = require('../util/Util'); /** @@ -265,4 +265,4 @@ class ShardClientUtil { } } -module.exports = ShardClientUtil; +exports.ShardClientUtil = ShardClientUtil; diff --git a/packages/discord.js/src/sharding/ShardingManager.js b/packages/discord.js/src/sharding/ShardingManager.js index 147d0c05f0671..ad6252e372650 100644 --- a/packages/discord.js/src/sharding/ShardingManager.js +++ b/packages/discord.js/src/sharding/ShardingManager.js @@ -6,7 +6,7 @@ const path = require('node:path'); const process = require('node:process'); const { setTimeout: sleep } = require('node:timers/promises'); const { Collection } = require('@discordjs/collection'); -const Shard = require('./Shard'); +const { Shard } = require('./Shard'); const { DiscordjsError, DiscordjsTypeError, DiscordjsRangeError, ErrorCodes } = require('../errors'); const { fetchRecommendedShardCount } = require('../util/Util'); @@ -328,4 +328,4 @@ class ShardingManager extends EventEmitter { } } -module.exports = ShardingManager; +exports.ShardingManager = ShardingManager; diff --git a/packages/discord.js/src/structures/ActionRow.js b/packages/discord.js/src/structures/ActionRow.js index ad9a59e2c848e..2bac8f4abc290 100644 --- a/packages/discord.js/src/structures/ActionRow.js +++ b/packages/discord.js/src/structures/ActionRow.js @@ -1,6 +1,6 @@ 'use strict'; -const Component = require('./Component'); +const { Component } = require('./Component'); const { createComponent } = require('../util/Components'); /** @@ -28,4 +28,4 @@ class ActionRow extends Component { } } -module.exports = ActionRow; +exports.ActionRow = ActionRow; diff --git a/packages/discord.js/src/structures/ActionRowBuilder.js b/packages/discord.js/src/structures/ActionRowBuilder.js index 2911d60a47994..720d261073913 100644 --- a/packages/discord.js/src/structures/ActionRowBuilder.js +++ b/packages/discord.js/src/structures/ActionRowBuilder.js @@ -27,7 +27,7 @@ class ActionRowBuilder extends BuildersActionRow { } } -module.exports = ActionRowBuilder; +exports.ActionRowBuilder = ActionRowBuilder; /** * @external BuildersActionRow diff --git a/packages/discord.js/src/structures/AnnouncementChannel.js b/packages/discord.js/src/structures/AnnouncementChannel.js index a23f8b26b67ff..13a4499ad9021 100644 --- a/packages/discord.js/src/structures/AnnouncementChannel.js +++ b/packages/discord.js/src/structures/AnnouncementChannel.js @@ -1,7 +1,7 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const BaseGuildTextChannel = require('./BaseGuildTextChannel'); +const { BaseGuildTextChannel } = require('./BaseGuildTextChannel'); const { DiscordjsError, ErrorCodes } = require('../errors'); /** @@ -29,4 +29,4 @@ class AnnouncementChannel extends BaseGuildTextChannel { } } -module.exports = AnnouncementChannel; +exports.AnnouncementChannel = AnnouncementChannel; diff --git a/packages/discord.js/src/structures/AnonymousGuild.js b/packages/discord.js/src/structures/AnonymousGuild.js index 70931bd91314d..da0e6fdc359b6 100644 --- a/packages/discord.js/src/structures/AnonymousGuild.js +++ b/packages/discord.js/src/structures/AnonymousGuild.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseGuild = require('./BaseGuild'); +const { BaseGuild } = require('./BaseGuild'); /** * Bundles common attributes and methods between {@link Guild} and {@link InviteGuild} @@ -94,4 +94,4 @@ class AnonymousGuild extends BaseGuild { } } -module.exports = AnonymousGuild; +exports.AnonymousGuild = AnonymousGuild; diff --git a/packages/discord.js/src/structures/ApplicationCommand.js b/packages/discord.js/src/structures/ApplicationCommand.js index 37eff9e46d5c1..0de5af11591fb 100644 --- a/packages/discord.js/src/structures/ApplicationCommand.js +++ b/packages/discord.js/src/structures/ApplicationCommand.js @@ -3,9 +3,9 @@ const { DiscordSnowflake } = require('@sapphire/snowflake'); const { ApplicationCommandOptionType } = require('discord-api-types/v10'); const isEqual = require('fast-deep-equal'); -const Base = require('./Base'); -const ApplicationCommandPermissionsManager = require('../managers/ApplicationCommandPermissionsManager'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { Base } = require('./Base'); +const { ApplicationCommandPermissionsManager } = require('../managers/ApplicationCommandPermissionsManager'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * Represents an application command. @@ -612,7 +612,7 @@ class ApplicationCommand extends Base { } } -module.exports = ApplicationCommand; +exports.ApplicationCommand = ApplicationCommand; /* eslint-disable max-len */ /** diff --git a/packages/discord.js/src/structures/ApplicationEmoji.js b/packages/discord.js/src/structures/ApplicationEmoji.js index 1688c65122437..0072d26b9febb 100644 --- a/packages/discord.js/src/structures/ApplicationEmoji.js +++ b/packages/discord.js/src/structures/ApplicationEmoji.js @@ -115,4 +115,4 @@ class ApplicationEmoji extends Emoji { } } -module.exports = ApplicationEmoji; +exports.ApplicationEmoji = ApplicationEmoji; diff --git a/packages/discord.js/src/structures/Attachment.js b/packages/discord.js/src/structures/Attachment.js index e175e5b60751e..9a05ebf2302aa 100644 --- a/packages/discord.js/src/structures/Attachment.js +++ b/packages/discord.js/src/structures/Attachment.js @@ -1,6 +1,6 @@ 'use strict'; -const AttachmentFlagsBitField = require('../util/AttachmentFlagsBitField.js'); +const { AttachmentFlagsBitField } = require('../util/AttachmentFlagsBitField.js'); const { basename, flatten } = require('../util/Util'); /** @@ -160,4 +160,4 @@ class Attachment { } } -module.exports = Attachment; +exports.Attachment = Attachment; diff --git a/packages/discord.js/src/structures/AttachmentBuilder.js b/packages/discord.js/src/structures/AttachmentBuilder.js index 7072345248719..91b24f6282017 100644 --- a/packages/discord.js/src/structures/AttachmentBuilder.js +++ b/packages/discord.js/src/structures/AttachmentBuilder.js @@ -102,7 +102,7 @@ class AttachmentBuilder { } } -module.exports = AttachmentBuilder; +exports.AttachmentBuilder = AttachmentBuilder; /** * @typedef {Object} AttachmentData diff --git a/packages/discord.js/src/structures/AutoModerationActionExecution.js b/packages/discord.js/src/structures/AutoModerationActionExecution.js index f71c361d36190..b1721515a6cfb 100644 --- a/packages/discord.js/src/structures/AutoModerationActionExecution.js +++ b/packages/discord.js/src/structures/AutoModerationActionExecution.js @@ -113,4 +113,4 @@ class AutoModerationActionExecution { } } -module.exports = AutoModerationActionExecution; +exports.AutoModerationActionExecution = AutoModerationActionExecution; diff --git a/packages/discord.js/src/structures/AutoModerationRule.js b/packages/discord.js/src/structures/AutoModerationRule.js index f6c872280a310..a1c1adad6dd7b 100644 --- a/packages/discord.js/src/structures/AutoModerationRule.js +++ b/packages/discord.js/src/structures/AutoModerationRule.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { _transformAPIAutoModerationAction } = require('../util/Transformers'); /** @@ -285,4 +285,4 @@ class AutoModerationRule extends Base { } } -module.exports = AutoModerationRule; +exports.AutoModerationRule = AutoModerationRule; diff --git a/packages/discord.js/src/structures/AutocompleteInteraction.js b/packages/discord.js/src/structures/AutocompleteInteraction.js index 4b7e39eee69e4..27132282ef5ca 100644 --- a/packages/discord.js/src/structures/AutocompleteInteraction.js +++ b/packages/discord.js/src/structures/AutocompleteInteraction.js @@ -1,8 +1,8 @@ 'use strict'; const { InteractionResponseType, Routes } = require('discord-api-types/v10'); -const BaseInteraction = require('./BaseInteraction'); -const CommandInteractionOptionResolver = require('./CommandInteractionOptionResolver'); +const { BaseInteraction } = require('./BaseInteraction'); +const { CommandInteractionOptionResolver } = require('./CommandInteractionOptionResolver'); const { DiscordjsError, ErrorCodes } = require('../errors'); /** @@ -99,4 +99,4 @@ class AutocompleteInteraction extends BaseInteraction { } } -module.exports = AutocompleteInteraction; +exports.AutocompleteInteraction = AutocompleteInteraction; diff --git a/packages/discord.js/src/structures/Base.js b/packages/discord.js/src/structures/Base.js index 102fb215d0125..539e3227da54e 100644 --- a/packages/discord.js/src/structures/Base.js +++ b/packages/discord.js/src/structures/Base.js @@ -40,4 +40,4 @@ class Base { } } -module.exports = Base; +exports.Base = Base; diff --git a/packages/discord.js/src/structures/BaseChannel.js b/packages/discord.js/src/structures/BaseChannel.js index ebb95682819c8..358d9fe5a604c 100644 --- a/packages/discord.js/src/structures/BaseChannel.js +++ b/packages/discord.js/src/structures/BaseChannel.js @@ -3,8 +3,8 @@ const { channelLink, channelMention } = require('@discordjs/formatters'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { ChannelType, Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); -const ChannelFlagsBitField = require('../util/ChannelFlagsBitField'); +const { Base } = require('./Base'); +const { ChannelFlagsBitField } = require('../util/ChannelFlagsBitField'); const { ThreadChannelTypes } = require('../util/Constants'); /** diff --git a/packages/discord.js/src/structures/BaseGuild.js b/packages/discord.js/src/structures/BaseGuild.js index b12ca447db68d..de77eaa21f75a 100644 --- a/packages/discord.js/src/structures/BaseGuild.js +++ b/packages/discord.js/src/structures/BaseGuild.js @@ -3,7 +3,7 @@ const { makeURLSearchParams } = require('@discordjs/rest'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { Routes, GuildFeature } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); /** * The base class for {@link Guild}, {@link OAuth2Guild} and {@link InviteGuild}. @@ -116,4 +116,4 @@ class BaseGuild extends Base { } } -module.exports = BaseGuild; +exports.BaseGuild = BaseGuild; diff --git a/packages/discord.js/src/structures/BaseGuildEmoji.js b/packages/discord.js/src/structures/BaseGuildEmoji.js index 0eb29670d99bb..7ea44920631d5 100644 --- a/packages/discord.js/src/structures/BaseGuildEmoji.js +++ b/packages/discord.js/src/structures/BaseGuildEmoji.js @@ -62,4 +62,4 @@ class BaseGuildEmoji extends Emoji { * @returns {string} */ -module.exports = BaseGuildEmoji; +exports.BaseGuildEmoji = BaseGuildEmoji; diff --git a/packages/discord.js/src/structures/BaseGuildTextChannel.js b/packages/discord.js/src/structures/BaseGuildTextChannel.js index c271565d750a6..94de8cc3a3fc7 100644 --- a/packages/discord.js/src/structures/BaseGuildTextChannel.js +++ b/packages/discord.js/src/structures/BaseGuildTextChannel.js @@ -1,9 +1,9 @@ 'use strict'; -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const GuildMessageManager = require('../managers/GuildMessageManager'); -const GuildTextThreadManager = require('../managers/GuildTextThreadManager'); +const { GuildChannel } = require('./GuildChannel'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); +const { GuildMessageManager } = require('../managers/GuildMessageManager'); +const { GuildTextThreadManager } = require('../managers/GuildTextThreadManager'); /** * Represents a text-based guild channel on Discord. @@ -193,4 +193,4 @@ class BaseGuildTextChannel extends GuildChannel { TextBasedChannel.applyToClass(BaseGuildTextChannel, true); -module.exports = BaseGuildTextChannel; +exports.BaseGuildTextChannel = BaseGuildTextChannel; diff --git a/packages/discord.js/src/structures/BaseGuildVoiceChannel.js b/packages/discord.js/src/structures/BaseGuildVoiceChannel.js index 220ac6c8d83b2..c07e887f89e23 100644 --- a/packages/discord.js/src/structures/BaseGuildVoiceChannel.js +++ b/packages/discord.js/src/structures/BaseGuildVoiceChannel.js @@ -2,9 +2,9 @@ const { Collection } = require('@discordjs/collection'); const { PermissionFlagsBits } = require('discord-api-types/v10'); -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const GuildMessageManager = require('../managers/GuildMessageManager'); +const { GuildChannel } = require('./GuildChannel'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); +const { GuildMessageManager } = require('../managers/GuildMessageManager'); /** * Represents a voice-based guild channel on Discord. @@ -231,4 +231,4 @@ class BaseGuildVoiceChannel extends GuildChannel { TextBasedChannel.applyToClass(BaseGuildVoiceChannel, true, ['lastPinAt']); -module.exports = BaseGuildVoiceChannel; +exports.BaseGuildVoiceChannel = BaseGuildVoiceChannel; diff --git a/packages/discord.js/src/structures/BaseInteraction.js b/packages/discord.js/src/structures/BaseInteraction.js index 1386a75f9eb4f..774ac628b7140 100644 --- a/packages/discord.js/src/structures/BaseInteraction.js +++ b/packages/discord.js/src/structures/BaseInteraction.js @@ -3,9 +3,9 @@ const { Collection } = require('@discordjs/collection'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { InteractionType, ApplicationCommandType, ComponentType } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { SelectMenuTypes } = require('../util/Constants'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * Represents an interaction. @@ -315,4 +315,4 @@ class BaseInteraction extends Base { } } -module.exports = BaseInteraction; +exports.BaseInteraction = BaseInteraction; diff --git a/packages/discord.js/src/structures/BaseSelectMenuComponent.js b/packages/discord.js/src/structures/BaseSelectMenuComponent.js index 7177f4329bbf0..dc7bb4c55a3f6 100644 --- a/packages/discord.js/src/structures/BaseSelectMenuComponent.js +++ b/packages/discord.js/src/structures/BaseSelectMenuComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const Component = require('./Component'); +const { Component } = require('./Component'); /** * Represents a select menu component @@ -53,4 +53,4 @@ class BaseSelectMenuComponent extends Component { } } -module.exports = BaseSelectMenuComponent; +exports.BaseSelectMenuComponent = BaseSelectMenuComponent; diff --git a/packages/discord.js/src/structures/ButtonBuilder.js b/packages/discord.js/src/structures/ButtonBuilder.js index ada4188a8e5c0..4c6a7830882bc 100644 --- a/packages/discord.js/src/structures/ButtonBuilder.js +++ b/packages/discord.js/src/structures/ButtonBuilder.js @@ -36,7 +36,7 @@ class ButtonBuilder extends BuildersButton { } } -module.exports = ButtonBuilder; +exports.ButtonBuilder = ButtonBuilder; /** * @external BuildersButton diff --git a/packages/discord.js/src/structures/ButtonComponent.js b/packages/discord.js/src/structures/ButtonComponent.js index 7319c3a5f19fd..48cae58a12957 100644 --- a/packages/discord.js/src/structures/ButtonComponent.js +++ b/packages/discord.js/src/structures/ButtonComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const Component = require('./Component'); +const { Component } = require('./Component'); /** * Represents a button component @@ -62,4 +62,4 @@ class ButtonComponent extends Component { } } -module.exports = ButtonComponent; +exports.ButtonComponent = ButtonComponent; diff --git a/packages/discord.js/src/structures/ButtonInteraction.js b/packages/discord.js/src/structures/ButtonInteraction.js index db57592a661b3..2a144b9ba48bd 100644 --- a/packages/discord.js/src/structures/ButtonInteraction.js +++ b/packages/discord.js/src/structures/ButtonInteraction.js @@ -1,6 +1,6 @@ 'use strict'; -const MessageComponentInteraction = require('./MessageComponentInteraction'); +const { MessageComponentInteraction } = require('./MessageComponentInteraction'); /** * Represents a button interaction. @@ -8,4 +8,4 @@ const MessageComponentInteraction = require('./MessageComponentInteraction'); */ class ButtonInteraction extends MessageComponentInteraction {} -module.exports = ButtonInteraction; +exports.ButtonInteraction = ButtonInteraction; diff --git a/packages/discord.js/src/structures/CategoryChannel.js b/packages/discord.js/src/structures/CategoryChannel.js index d03804466b2b4..3a8c257c9dd3a 100644 --- a/packages/discord.js/src/structures/CategoryChannel.js +++ b/packages/discord.js/src/structures/CategoryChannel.js @@ -1,7 +1,7 @@ 'use strict'; -const GuildChannel = require('./GuildChannel'); -const CategoryChannelChildManager = require('../managers/CategoryChannelChildManager'); +const { GuildChannel } = require('./GuildChannel'); +const { CategoryChannelChildManager } = require('../managers/CategoryChannelChildManager'); /** * Represents a guild category channel on Discord. @@ -42,4 +42,4 @@ class CategoryChannel extends GuildChannel { } } -module.exports = CategoryChannel; +exports.CategoryChannel = CategoryChannel; diff --git a/packages/discord.js/src/structures/ChannelSelectMenuBuilder.js b/packages/discord.js/src/structures/ChannelSelectMenuBuilder.js index 6d994740587b5..0de8e787155ed 100644 --- a/packages/discord.js/src/structures/ChannelSelectMenuBuilder.js +++ b/packages/discord.js/src/structures/ChannelSelectMenuBuilder.js @@ -23,7 +23,7 @@ class ChannelSelectMenuBuilder extends BuildersChannelSelectMenu { } } -module.exports = ChannelSelectMenuBuilder; +exports.ChannelSelectMenuBuilder = ChannelSelectMenuBuilder; /** * @external BuildersChannelSelectMenu diff --git a/packages/discord.js/src/structures/ChannelSelectMenuComponent.js b/packages/discord.js/src/structures/ChannelSelectMenuComponent.js index 90a706315fb07..62adb82ac9e90 100644 --- a/packages/discord.js/src/structures/ChannelSelectMenuComponent.js +++ b/packages/discord.js/src/structures/ChannelSelectMenuComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); +const { BaseSelectMenuComponent } = require('./BaseSelectMenuComponent'); /** * Represents a channel select menu component @@ -17,4 +17,4 @@ class ChannelSelectMenuComponent extends BaseSelectMenuComponent { } } -module.exports = ChannelSelectMenuComponent; +exports.ChannelSelectMenuComponent = ChannelSelectMenuComponent; diff --git a/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js b/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js index a5e9c99b86f01..a1714c5f038c9 100644 --- a/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/ChannelSelectMenuInteraction.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const MessageComponentInteraction = require('./MessageComponentInteraction'); +const { MessageComponentInteraction } = require('./MessageComponentInteraction'); /** * Represents a {@link ComponentType.ChannelSelect} select menu interaction. @@ -30,4 +30,4 @@ class ChannelSelectMenuInteraction extends MessageComponentInteraction { } } -module.exports = ChannelSelectMenuInteraction; +exports.ChannelSelectMenuInteraction = ChannelSelectMenuInteraction; diff --git a/packages/discord.js/src/structures/ChatInputCommandInteraction.js b/packages/discord.js/src/structures/ChatInputCommandInteraction.js index 17f6589366f8f..0e23cf86cd7a1 100644 --- a/packages/discord.js/src/structures/ChatInputCommandInteraction.js +++ b/packages/discord.js/src/structures/ChatInputCommandInteraction.js @@ -1,7 +1,7 @@ 'use strict'; -const CommandInteraction = require('./CommandInteraction'); -const CommandInteractionOptionResolver = require('./CommandInteractionOptionResolver'); +const { CommandInteraction } = require('./CommandInteraction'); +const { CommandInteractionOptionResolver } = require('./CommandInteractionOptionResolver'); const { transformResolved } = require('../util/Util'); /** @@ -39,4 +39,4 @@ class ChatInputCommandInteraction extends CommandInteraction { } } -module.exports = ChatInputCommandInteraction; +exports.ChatInputCommandInteraction = ChatInputCommandInteraction; diff --git a/packages/discord.js/src/structures/ClientApplication.js b/packages/discord.js/src/structures/ClientApplication.js index 9e1492b42b161..eac279ac7fc0a 100644 --- a/packages/discord.js/src/structures/ClientApplication.js +++ b/packages/discord.js/src/structures/ClientApplication.js @@ -4,15 +4,15 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); const { ApplicationRoleConnectionMetadata } = require('./ApplicationRoleConnectionMetadata'); const { SKU } = require('./SKU'); -const Team = require('./Team'); -const Application = require('./interfaces/Application'); -const ApplicationCommandManager = require('../managers/ApplicationCommandManager'); -const ApplicationEmojiManager = require('../managers/ApplicationEmojiManager'); +const { Team } = require('./Team'); +const { Application } = require('./interfaces/Application'); +const { ApplicationCommandManager } = require('../managers/ApplicationCommandManager'); +const { ApplicationEmojiManager } = require('../managers/ApplicationEmojiManager'); const { EntitlementManager } = require('../managers/EntitlementManager'); const { SubscriptionManager } = require('../managers/SubscriptionManager'); -const ApplicationFlagsBitField = require('../util/ApplicationFlagsBitField'); +const { ApplicationFlagsBitField } = require('../util/ApplicationFlagsBitField'); const { resolveImage } = require('../util/DataResolver'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * @typedef {Object} ClientApplicationInstallParams @@ -381,4 +381,4 @@ class ClientApplication extends Application { } } -module.exports = ClientApplication; +exports.ClientApplication = ClientApplication; diff --git a/packages/discord.js/src/structures/ClientPresence.js b/packages/discord.js/src/structures/ClientPresence.js index bec6ab169ef60..d4134408d39fc 100644 --- a/packages/discord.js/src/structures/ClientPresence.js +++ b/packages/discord.js/src/structures/ClientPresence.js @@ -81,4 +81,4 @@ class ClientPresence extends Presence { } } -module.exports = ClientPresence; +exports.ClientPresence = ClientPresence; diff --git a/packages/discord.js/src/structures/ClientUser.js b/packages/discord.js/src/structures/ClientUser.js index 98e795a703485..af06ba50c42e9 100644 --- a/packages/discord.js/src/structures/ClientUser.js +++ b/packages/discord.js/src/structures/ClientUser.js @@ -1,7 +1,7 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const User = require('./User'); +const { User } = require('./User'); const { resolveImage } = require('../util/DataResolver'); /** @@ -203,4 +203,4 @@ class ClientUser extends User { } } -module.exports = ClientUser; +exports.ClientUser = ClientUser; diff --git a/packages/discord.js/src/structures/CommandInteraction.js b/packages/discord.js/src/structures/CommandInteraction.js index 88086f9605b2c..2526e4345f0ee 100644 --- a/packages/discord.js/src/structures/CommandInteraction.js +++ b/packages/discord.js/src/structures/CommandInteraction.js @@ -1,9 +1,9 @@ 'use strict'; -const Attachment = require('./Attachment'); -const BaseInteraction = require('./BaseInteraction'); -const InteractionWebhook = require('./InteractionWebhook'); -const InteractionResponses = require('./interfaces/InteractionResponses'); +const { Attachment } = require('./Attachment'); +const { BaseInteraction } = require('./BaseInteraction'); +const { InteractionWebhook } = require('./InteractionWebhook'); +const { InteractionResponses } = require('./interfaces/InteractionResponses'); /** * Represents a command interaction. @@ -158,4 +158,4 @@ class CommandInteraction extends BaseInteraction { InteractionResponses.applyToClass(CommandInteraction, ['deferUpdate', 'update']); -module.exports = CommandInteraction; +exports.CommandInteraction = CommandInteraction; diff --git a/packages/discord.js/src/structures/CommandInteractionOptionResolver.js b/packages/discord.js/src/structures/CommandInteractionOptionResolver.js index b59f6328e40cf..a63b39e8d2e75 100644 --- a/packages/discord.js/src/structures/CommandInteractionOptionResolver.js +++ b/packages/discord.js/src/structures/CommandInteractionOptionResolver.js @@ -304,4 +304,4 @@ class CommandInteractionOptionResolver { } } -module.exports = CommandInteractionOptionResolver; +exports.CommandInteractionOptionResolver = CommandInteractionOptionResolver; diff --git a/packages/discord.js/src/structures/Component.js b/packages/discord.js/src/structures/Component.js index 10ba27d058554..fbe464f76278a 100644 --- a/packages/discord.js/src/structures/Component.js +++ b/packages/discord.js/src/structures/Component.js @@ -44,4 +44,4 @@ class Component { } } -module.exports = Component; +exports.Component = Component; diff --git a/packages/discord.js/src/structures/ContextMenuCommandInteraction.js b/packages/discord.js/src/structures/ContextMenuCommandInteraction.js index 7df06b68b35c6..47decb2971c46 100644 --- a/packages/discord.js/src/structures/ContextMenuCommandInteraction.js +++ b/packages/discord.js/src/structures/ContextMenuCommandInteraction.js @@ -2,8 +2,8 @@ const { lazy } = require('@discordjs/util'); const { ApplicationCommandOptionType } = require('discord-api-types/v10'); -const CommandInteraction = require('./CommandInteraction'); -const CommandInteractionOptionResolver = require('./CommandInteractionOptionResolver'); +const { CommandInteraction } = require('./CommandInteraction'); +const { CommandInteractionOptionResolver } = require('./CommandInteractionOptionResolver'); const { transformResolved } = require('../util/Util'); const getMessage = lazy(() => require('./Message').Message); @@ -62,4 +62,4 @@ class ContextMenuCommandInteraction extends CommandInteraction { } } -module.exports = ContextMenuCommandInteraction; +exports.ContextMenuCommandInteraction = ContextMenuCommandInteraction; diff --git a/packages/discord.js/src/structures/DMChannel.js b/packages/discord.js/src/structures/DMChannel.js index ee466442a2190..42f178685fa07 100644 --- a/packages/discord.js/src/structures/DMChannel.js +++ b/packages/discord.js/src/structures/DMChannel.js @@ -3,9 +3,9 @@ const { userMention } = require('@discordjs/formatters'); const { ChannelType } = require('discord-api-types/v10'); const { BaseChannel } = require('./BaseChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const DMMessageManager = require('../managers/DMMessageManager'); -const Partials = require('../util/Partials'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); +const { DMMessageManager } = require('../managers/DMMessageManager'); +const { Partials } = require('../util/Partials'); /** * Represents a direct message channel between two users. @@ -126,4 +126,4 @@ TextBasedChannel.applyToClass(DMChannel, true, [ 'setNSFW', ]); -module.exports = DMChannel; +exports.DMChannel = DMChannel; diff --git a/packages/discord.js/src/structures/DirectoryChannel.js b/packages/discord.js/src/structures/DirectoryChannel.js index 870eff955a90e..7975ba5963a72 100644 --- a/packages/discord.js/src/structures/DirectoryChannel.js +++ b/packages/discord.js/src/structures/DirectoryChannel.js @@ -33,4 +33,4 @@ class DirectoryChannel extends BaseChannel { } } -module.exports = DirectoryChannel; +exports.DirectoryChannel = DirectoryChannel; diff --git a/packages/discord.js/src/structures/Embed.js b/packages/discord.js/src/structures/Embed.js index c1534ec679c43..3021493339b9e 100644 --- a/packages/discord.js/src/structures/Embed.js +++ b/packages/discord.js/src/structures/Embed.js @@ -234,4 +234,4 @@ class Embed { } } -module.exports = Embed; +exports.Embed = Embed; diff --git a/packages/discord.js/src/structures/EmbedBuilder.js b/packages/discord.js/src/structures/EmbedBuilder.js index 10e445ce5ff74..cd995aa0687f3 100644 --- a/packages/discord.js/src/structures/EmbedBuilder.js +++ b/packages/discord.js/src/structures/EmbedBuilder.js @@ -42,7 +42,7 @@ class EmbedBuilder extends BuildersEmbed { } } -module.exports = EmbedBuilder; +exports.EmbedBuilder = EmbedBuilder; /** * @external BuildersEmbed diff --git a/packages/discord.js/src/structures/Emoji.js b/packages/discord.js/src/structures/Emoji.js index 0dd368e5ddf69..f1104a8d997ad 100644 --- a/packages/discord.js/src/structures/Emoji.js +++ b/packages/discord.js/src/structures/Emoji.js @@ -2,7 +2,7 @@ const { formatEmoji } = require('@discordjs/formatters'); const { DiscordSnowflake } = require('@sapphire/snowflake'); -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents an emoji, see {@link ApplicationEmoji}, {@link GuildEmoji} and {@link ReactionEmoji}. diff --git a/packages/discord.js/src/structures/Entitlement.js b/packages/discord.js/src/structures/Entitlement.js index f7652d61b44f0..9c518a3b54412 100644 --- a/packages/discord.js/src/structures/Entitlement.js +++ b/packages/discord.js/src/structures/Entitlement.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents an Entitlement diff --git a/packages/discord.js/src/structures/ForumChannel.js b/packages/discord.js/src/structures/ForumChannel.js index 9c1f9a682abad..a042e2edf5c83 100644 --- a/packages/discord.js/src/structures/ForumChannel.js +++ b/packages/discord.js/src/structures/ForumChannel.js @@ -1,6 +1,6 @@ 'use strict'; -const ThreadOnlyChannel = require('./ThreadOnlyChannel'); +const { ThreadOnlyChannel } = require('./ThreadOnlyChannel'); /** * Represents a forum channel. @@ -28,4 +28,4 @@ class ForumChannel extends ThreadOnlyChannel { } } -module.exports = ForumChannel; +exports.ForumChannel = ForumChannel; diff --git a/packages/discord.js/src/structures/Guild.js b/packages/discord.js/src/structures/Guild.js index fa11307fca392..9fbcae89ee4a8 100644 --- a/packages/discord.js/src/structures/Guild.js +++ b/packages/discord.js/src/structures/Guild.js @@ -4,30 +4,30 @@ const { Collection } = require('@discordjs/collection'); const { makeURLSearchParams } = require('@discordjs/rest'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { ChannelType, GuildPremiumTier, Routes, GuildFeature } = require('discord-api-types/v10'); -const AnonymousGuild = require('./AnonymousGuild'); -const GuildAuditLogs = require('./GuildAuditLogs'); +const { AnonymousGuild } = require('./AnonymousGuild'); +const { GuildAuditLogs } = require('./GuildAuditLogs'); const { GuildOnboarding } = require('./GuildOnboarding'); -const GuildPreview = require('./GuildPreview'); -const GuildTemplate = require('./GuildTemplate'); -const Integration = require('./Integration'); -const Webhook = require('./Webhook'); -const WelcomeScreen = require('./WelcomeScreen'); +const { GuildPreview } = require('./GuildPreview'); +const { GuildTemplate } = require('./GuildTemplate'); +const { Integration } = require('./Integration'); +const { Webhook } = require('./Webhook'); +const { WelcomeScreen } = require('./WelcomeScreen'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); -const AutoModerationRuleManager = require('../managers/AutoModerationRuleManager'); -const GuildApplicationCommandManager = require('../managers/GuildApplicationCommandManager'); -const GuildBanManager = require('../managers/GuildBanManager'); -const GuildChannelManager = require('../managers/GuildChannelManager'); -const GuildEmojiManager = require('../managers/GuildEmojiManager'); -const GuildInviteManager = require('../managers/GuildInviteManager'); -const GuildMemberManager = require('../managers/GuildMemberManager'); -const GuildScheduledEventManager = require('../managers/GuildScheduledEventManager'); -const GuildStickerManager = require('../managers/GuildStickerManager'); -const PresenceManager = require('../managers/PresenceManager'); -const RoleManager = require('../managers/RoleManager'); -const StageInstanceManager = require('../managers/StageInstanceManager'); -const VoiceStateManager = require('../managers/VoiceStateManager'); +const { AutoModerationRuleManager } = require('../managers/AutoModerationRuleManager'); +const { GuildApplicationCommandManager } = require('../managers/GuildApplicationCommandManager'); +const { GuildBanManager } = require('../managers/GuildBanManager'); +const { GuildChannelManager } = require('../managers/GuildChannelManager'); +const { GuildEmojiManager } = require('../managers/GuildEmojiManager'); +const { GuildInviteManager } = require('../managers/GuildInviteManager'); +const { GuildMemberManager } = require('../managers/GuildMemberManager'); +const { GuildScheduledEventManager } = require('../managers/GuildScheduledEventManager'); +const { GuildStickerManager } = require('../managers/GuildStickerManager'); +const { PresenceManager } = require('../managers/PresenceManager'); +const { RoleManager } = require('../managers/RoleManager'); +const { StageInstanceManager } = require('../managers/StageInstanceManager'); +const { VoiceStateManager } = require('../managers/VoiceStateManager'); const { resolveImage } = require('../util/DataResolver'); -const SystemChannelFlagsBitField = require('../util/SystemChannelFlagsBitField'); +const { SystemChannelFlagsBitField } = require('../util/SystemChannelFlagsBitField'); const { discordSort, getSortableGroupTypes, resolvePartialEmoji } = require('../util/Util'); /** diff --git a/packages/discord.js/src/structures/GuildAuditLogs.js b/packages/discord.js/src/structures/GuildAuditLogs.js index 2ce13a8da3128..68ad97e8dce5a 100644 --- a/packages/discord.js/src/structures/GuildAuditLogs.js +++ b/packages/discord.js/src/structures/GuildAuditLogs.js @@ -1,10 +1,10 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const ApplicationCommand = require('./ApplicationCommand'); -const GuildAuditLogsEntry = require('./GuildAuditLogsEntry'); -const Integration = require('./Integration'); -const Webhook = require('./Webhook'); +const { ApplicationCommand } = require('./ApplicationCommand'); +const { GuildAuditLogsEntry } = require('./GuildAuditLogsEntry'); +const { Integration } = require('./Integration'); +const { Webhook } = require('./Webhook'); const { flatten } = require('../util/Util'); /** @@ -88,4 +88,4 @@ class GuildAuditLogs { } } -module.exports = GuildAuditLogs; +exports.GuildAuditLogs = GuildAuditLogs; diff --git a/packages/discord.js/src/structures/GuildAuditLogsEntry.js b/packages/discord.js/src/structures/GuildAuditLogsEntry.js index 2d6430b426594..318036e1d547c 100644 --- a/packages/discord.js/src/structures/GuildAuditLogsEntry.js +++ b/packages/discord.js/src/structures/GuildAuditLogsEntry.js @@ -2,15 +2,15 @@ const { DiscordSnowflake } = require('@sapphire/snowflake'); const { AuditLogOptionsType, AuditLogEvent } = require('discord-api-types/v10'); -const AutoModerationRule = require('./AutoModerationRule'); +const { AutoModerationRule } = require('./AutoModerationRule'); const { GuildOnboardingPrompt } = require('./GuildOnboardingPrompt'); const { GuildScheduledEvent } = require('./GuildScheduledEvent'); -const Integration = require('./Integration'); -const Invite = require('./Invite'); +const { Integration } = require('./Integration'); +const { Invite } = require('./Invite'); const { StageInstance } = require('./StageInstance'); const { Sticker } = require('./Sticker'); -const Webhook = require('./Webhook'); -const Partials = require('../util/Partials'); +const { Webhook } = require('./Webhook'); +const { Partials } = require('../util/Partials'); const { flatten } = require('../util/Util'); const Targets = { @@ -516,4 +516,4 @@ class GuildAuditLogsEntry { } } -module.exports = GuildAuditLogsEntry; +exports.GuildAuditLogsEntry = GuildAuditLogsEntry; diff --git a/packages/discord.js/src/structures/GuildBan.js b/packages/discord.js/src/structures/GuildBan.js index 9c5a10ed677a3..cc1c01d1cb7eb 100644 --- a/packages/discord.js/src/structures/GuildBan.js +++ b/packages/discord.js/src/structures/GuildBan.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents a ban in a guild on Discord. @@ -56,4 +56,4 @@ class GuildBan extends Base { } } -module.exports = GuildBan; +exports.GuildBan = GuildBan; diff --git a/packages/discord.js/src/structures/GuildChannel.js b/packages/discord.js/src/structures/GuildChannel.js index e0e9ee027e11a..e3534dfdf82e8 100644 --- a/packages/discord.js/src/structures/GuildChannel.js +++ b/packages/discord.js/src/structures/GuildChannel.js @@ -4,9 +4,9 @@ const { Snowflake } = require('@sapphire/snowflake'); const { PermissionFlagsBits, ChannelType } = require('discord-api-types/v10'); const { BaseChannel } = require('./BaseChannel'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const PermissionOverwriteManager = require('../managers/PermissionOverwriteManager'); +const { PermissionOverwriteManager } = require('../managers/PermissionOverwriteManager'); const { VoiceBasedChannelTypes } = require('../util/Constants'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); const { getSortableGroupTypes } = require('../util/Util'); /** @@ -472,4 +472,4 @@ class GuildChannel extends BaseChannel { } } -module.exports = GuildChannel; +exports.GuildChannel = GuildChannel; diff --git a/packages/discord.js/src/structures/GuildEmoji.js b/packages/discord.js/src/structures/GuildEmoji.js index a9f781a5360e4..52ff7ce731ccd 100644 --- a/packages/discord.js/src/structures/GuildEmoji.js +++ b/packages/discord.js/src/structures/GuildEmoji.js @@ -1,9 +1,9 @@ 'use strict'; const { PermissionFlagsBits } = require('discord-api-types/v10'); -const BaseGuildEmoji = require('./BaseGuildEmoji'); +const { BaseGuildEmoji } = require('./BaseGuildEmoji'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const GuildEmojiRoleManager = require('../managers/GuildEmojiRoleManager'); +const { GuildEmojiRoleManager } = require('../managers/GuildEmojiRoleManager'); /** * Represents a custom emoji. @@ -145,4 +145,4 @@ class GuildEmoji extends BaseGuildEmoji { } } -module.exports = GuildEmoji; +exports.GuildEmoji = GuildEmoji; diff --git a/packages/discord.js/src/structures/GuildMember.js b/packages/discord.js/src/structures/GuildMember.js index b1f1b52834609..d280a742e049a 100644 --- a/packages/discord.js/src/structures/GuildMember.js +++ b/packages/discord.js/src/structures/GuildMember.js @@ -1,13 +1,13 @@ 'use strict'; const { PermissionFlagsBits } = require('discord-api-types/v10'); -const Base = require('./Base'); -const VoiceState = require('./VoiceState'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); +const { Base } = require('./Base'); +const { VoiceState } = require('./VoiceState'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const GuildMemberRoleManager = require('../managers/GuildMemberRoleManager'); +const { GuildMemberRoleManager } = require('../managers/GuildMemberRoleManager'); const { GuildMemberFlagsBitField } = require('../util/GuildMemberFlagsBitField'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * Represents a member of a guild on Discord. diff --git a/packages/discord.js/src/structures/GuildOnboarding.js b/packages/discord.js/src/structures/GuildOnboarding.js index 2e91f48bee641..e3ba5c1c2228a 100644 --- a/packages/discord.js/src/structures/GuildOnboarding.js +++ b/packages/discord.js/src/structures/GuildOnboarding.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { GuildOnboardingPrompt } = require('./GuildOnboardingPrompt'); /** diff --git a/packages/discord.js/src/structures/GuildOnboardingPrompt.js b/packages/discord.js/src/structures/GuildOnboardingPrompt.js index 4de3f5dd79581..d25271326e3da 100644 --- a/packages/discord.js/src/structures/GuildOnboardingPrompt.js +++ b/packages/discord.js/src/structures/GuildOnboardingPrompt.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { GuildOnboardingPromptOption } = require('./GuildOnboardingPromptOption'); /** diff --git a/packages/discord.js/src/structures/GuildOnboardingPromptOption.js b/packages/discord.js/src/structures/GuildOnboardingPromptOption.js index a07bc55977c9b..aa39bf61c2716 100644 --- a/packages/discord.js/src/structures/GuildOnboardingPromptOption.js +++ b/packages/discord.js/src/structures/GuildOnboardingPromptOption.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { Emoji } = require('./Emoji.js'); /** diff --git a/packages/discord.js/src/structures/GuildPreview.js b/packages/discord.js/src/structures/GuildPreview.js index 6ff20265b3e14..386bbfc044adf 100644 --- a/packages/discord.js/src/structures/GuildPreview.js +++ b/packages/discord.js/src/structures/GuildPreview.js @@ -3,8 +3,8 @@ const { Collection } = require('@discordjs/collection'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); -const GuildPreviewEmoji = require('./GuildPreviewEmoji'); +const { Base } = require('./Base'); +const { GuildPreviewEmoji } = require('./GuildPreviewEmoji'); const { Sticker } = require('./Sticker'); /** @@ -190,4 +190,4 @@ class GuildPreview extends Base { } } -module.exports = GuildPreview; +exports.GuildPreview = GuildPreview; diff --git a/packages/discord.js/src/structures/GuildPreviewEmoji.js b/packages/discord.js/src/structures/GuildPreviewEmoji.js index 144b41d906a53..ed66052b1793a 100644 --- a/packages/discord.js/src/structures/GuildPreviewEmoji.js +++ b/packages/discord.js/src/structures/GuildPreviewEmoji.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseGuildEmoji = require('./BaseGuildEmoji'); +const { BaseGuildEmoji } = require('./BaseGuildEmoji'); /** * Represents an instance of an emoji belonging to a public guild obtained through Discord's preview endpoint. @@ -24,4 +24,4 @@ class GuildPreviewEmoji extends BaseGuildEmoji { } } -module.exports = GuildPreviewEmoji; +exports.GuildPreviewEmoji = GuildPreviewEmoji; diff --git a/packages/discord.js/src/structures/GuildScheduledEvent.js b/packages/discord.js/src/structures/GuildScheduledEvent.js index c1d4cbc1beb00..4ba8b12552b2d 100644 --- a/packages/discord.js/src/structures/GuildScheduledEvent.js +++ b/packages/discord.js/src/structures/GuildScheduledEvent.js @@ -2,7 +2,7 @@ const { DiscordSnowflake } = require('@sapphire/snowflake'); const { GuildScheduledEventStatus, GuildScheduledEventEntityType, RouteBases } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { DiscordjsError, ErrorCodes } = require('../errors'); /** diff --git a/packages/discord.js/src/structures/GuildTemplate.js b/packages/discord.js/src/structures/GuildTemplate.js index 7806867b5797c..1128c783fcd4e 100644 --- a/packages/discord.js/src/structures/GuildTemplate.js +++ b/packages/discord.js/src/structures/GuildTemplate.js @@ -2,9 +2,9 @@ const { setTimeout, clearTimeout } = require('node:timers'); const { RouteBases, Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { resolveImage } = require('../util/DataResolver'); -const Events = require('../util/Events'); +const { Events } = require('../util/Events'); /** * Represents the template for a guild. @@ -238,4 +238,4 @@ class GuildTemplate extends Base { } } -module.exports = GuildTemplate; +exports.GuildTemplate = GuildTemplate; diff --git a/packages/discord.js/src/structures/Integration.js b/packages/discord.js/src/structures/Integration.js index fa9777b38c8c8..8a03f71e13607 100644 --- a/packages/discord.js/src/structures/Integration.js +++ b/packages/discord.js/src/structures/Integration.js @@ -1,8 +1,8 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); -const IntegrationApplication = require('./IntegrationApplication'); +const { Base } = require('./Base'); +const { IntegrationApplication } = require('./IntegrationApplication'); /** * The information account for an integration @@ -217,4 +217,4 @@ class Integration extends Base { } } -module.exports = Integration; +exports.Integration = Integration; diff --git a/packages/discord.js/src/structures/IntegrationApplication.js b/packages/discord.js/src/structures/IntegrationApplication.js index 49850084880e0..ef2f6902a77e9 100644 --- a/packages/discord.js/src/structures/IntegrationApplication.js +++ b/packages/discord.js/src/structures/IntegrationApplication.js @@ -1,6 +1,6 @@ 'use strict'; -const Application = require('./interfaces/Application'); +const { Application } = require('./interfaces/Application'); /** * Represents an Integration's OAuth2 Application. @@ -82,4 +82,4 @@ class IntegrationApplication extends Application { } } -module.exports = IntegrationApplication; +exports.IntegrationApplication = IntegrationApplication; diff --git a/packages/discord.js/src/structures/InteractionCallback.js b/packages/discord.js/src/structures/InteractionCallback.js index 4abc831470e9a..406e1ef707d8b 100644 --- a/packages/discord.js/src/structures/InteractionCallback.js +++ b/packages/discord.js/src/structures/InteractionCallback.js @@ -71,4 +71,4 @@ class InteractionCallback { } } -module.exports = InteractionCallback; +exports.InteractionCallback = InteractionCallback; diff --git a/packages/discord.js/src/structures/InteractionCallbackResource.js b/packages/discord.js/src/structures/InteractionCallbackResource.js index ffb088d8100ee..ef2d7430df844 100644 --- a/packages/discord.js/src/structures/InteractionCallbackResource.js +++ b/packages/discord.js/src/structures/InteractionCallbackResource.js @@ -49,4 +49,4 @@ class InteractionCallbackResource { } } -module.exports = InteractionCallbackResource; +exports.InteractionCallbackResource = InteractionCallbackResource; diff --git a/packages/discord.js/src/structures/InteractionCallbackResponse.js b/packages/discord.js/src/structures/InteractionCallbackResponse.js index c114648398ae8..b3c9adbfb72c4 100644 --- a/packages/discord.js/src/structures/InteractionCallbackResponse.js +++ b/packages/discord.js/src/structures/InteractionCallbackResponse.js @@ -1,7 +1,7 @@ 'use strict'; -const InteractionCallback = require('./InteractionCallback'); -const InteractionCallbackResource = require('./InteractionCallbackResource'); +const { InteractionCallback } = require('./InteractionCallback'); +const { InteractionCallbackResource } = require('./InteractionCallbackResource'); /** * Represents an interaction's response @@ -30,4 +30,4 @@ class InteractionCallbackResponse { } } -module.exports = InteractionCallbackResponse; +exports.InteractionCallbackResponse = InteractionCallbackResponse; diff --git a/packages/discord.js/src/structures/InteractionCollector.js b/packages/discord.js/src/structures/InteractionCollector.js index bb8e6c7676fc8..abe307405ef56 100644 --- a/packages/discord.js/src/structures/InteractionCollector.js +++ b/packages/discord.js/src/structures/InteractionCollector.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Collector = require('./interfaces/Collector'); -const Events = require('../util/Events'); +const { Collector } = require('./interfaces/Collector'); +const { Events } = require('../util/Events'); /** * @typedef {CollectorOptions} InteractionCollectorOptions @@ -266,4 +266,4 @@ class InteractionCollector extends Collector { } } -module.exports = InteractionCollector; +exports.InteractionCollector = InteractionCollector; diff --git a/packages/discord.js/src/structures/InteractionResponse.js b/packages/discord.js/src/structures/InteractionResponse.js index 9b372e3932d62..dfd29bf35053b 100644 --- a/packages/discord.js/src/structures/InteractionResponse.js +++ b/packages/discord.js/src/structures/InteractionResponse.js @@ -98,5 +98,5 @@ class InteractionResponse { } // eslint-disable-next-line import/order -const InteractionCollector = require('./InteractionCollector'); -module.exports = InteractionResponse; +const { InteractionCollector } = require('./InteractionCollector'); +exports.InteractionResponse = InteractionResponse; diff --git a/packages/discord.js/src/structures/InteractionWebhook.js b/packages/discord.js/src/structures/InteractionWebhook.js index 58eb531435e7a..b168131691103 100644 --- a/packages/discord.js/src/structures/InteractionWebhook.js +++ b/packages/discord.js/src/structures/InteractionWebhook.js @@ -1,6 +1,6 @@ 'use strict'; -const Webhook = require('./Webhook'); +const { Webhook } = require('./Webhook'); /** * Represents a webhook for an Interaction @@ -56,4 +56,4 @@ class InteractionWebhook { Webhook.applyToClass(InteractionWebhook, ['sendSlackMessage', 'edit', 'delete', 'createdTimestamp', 'createdAt']); -module.exports = InteractionWebhook; +exports.InteractionWebhook = InteractionWebhook; diff --git a/packages/discord.js/src/structures/Invite.js b/packages/discord.js/src/structures/Invite.js index 973d2501fd24a..7b97ae8d29d00 100644 --- a/packages/discord.js/src/structures/Invite.js +++ b/packages/discord.js/src/structures/Invite.js @@ -1,9 +1,9 @@ 'use strict'; const { RouteBases, Routes, PermissionFlagsBits } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { GuildScheduledEvent } = require('./GuildScheduledEvent'); -const IntegrationApplication = require('./IntegrationApplication'); +const { IntegrationApplication } = require('./IntegrationApplication'); const { DiscordjsError, ErrorCodes } = require('../errors'); /** @@ -32,7 +32,7 @@ class Invite extends Base { } _patch(data) { - const InviteGuild = require('./InviteGuild'); + const { InviteGuild } = require('./InviteGuild'); /** * The guild the invite is for including welcome screen data if present * @type {?(Guild|InviteGuild)} @@ -314,4 +314,4 @@ class Invite extends Base { } } -module.exports = Invite; +exports.Invite = Invite; diff --git a/packages/discord.js/src/structures/InviteGuild.js b/packages/discord.js/src/structures/InviteGuild.js index 8efd9805ec197..986d9609d99fa 100644 --- a/packages/discord.js/src/structures/InviteGuild.js +++ b/packages/discord.js/src/structures/InviteGuild.js @@ -1,7 +1,7 @@ 'use strict'; -const AnonymousGuild = require('./AnonymousGuild'); -const WelcomeScreen = require('./WelcomeScreen'); +const { AnonymousGuild } = require('./AnonymousGuild'); +const { WelcomeScreen } = require('./WelcomeScreen'); /** * Represents a guild received from an invite, includes welcome screen data if available. @@ -19,4 +19,4 @@ class InviteGuild extends AnonymousGuild { } } -module.exports = InviteGuild; +exports.InviteGuild = InviteGuild; diff --git a/packages/discord.js/src/structures/MediaChannel.js b/packages/discord.js/src/structures/MediaChannel.js index 5b21c410976be..991846c8d924b 100644 --- a/packages/discord.js/src/structures/MediaChannel.js +++ b/packages/discord.js/src/structures/MediaChannel.js @@ -1,6 +1,6 @@ 'use strict'; -const ThreadOnlyChannel = require('./ThreadOnlyChannel'); +const { ThreadOnlyChannel } = require('./ThreadOnlyChannel'); /** * Represents a media channel. @@ -8,4 +8,4 @@ const ThreadOnlyChannel = require('./ThreadOnlyChannel'); */ class MediaChannel extends ThreadOnlyChannel {} -module.exports = MediaChannel; +exports.MediaChannel = MediaChannel; diff --git a/packages/discord.js/src/structures/MentionableSelectMenuBuilder.js b/packages/discord.js/src/structures/MentionableSelectMenuBuilder.js index b22f600b90e38..2de0c527356f9 100644 --- a/packages/discord.js/src/structures/MentionableSelectMenuBuilder.js +++ b/packages/discord.js/src/structures/MentionableSelectMenuBuilder.js @@ -24,7 +24,7 @@ class MentionableSelectMenuBuilder extends BuildersMentionableSelectMenu { } } -module.exports = MentionableSelectMenuBuilder; +exports.MentionableSelectMenuBuilder = MentionableSelectMenuBuilder; /** * @external BuildersMentionableSelectMenu diff --git a/packages/discord.js/src/structures/MentionableSelectMenuComponent.js b/packages/discord.js/src/structures/MentionableSelectMenuComponent.js index d0f75c356e0c1..9add25f11c281 100644 --- a/packages/discord.js/src/structures/MentionableSelectMenuComponent.js +++ b/packages/discord.js/src/structures/MentionableSelectMenuComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); +const { BaseSelectMenuComponent } = require('./BaseSelectMenuComponent'); /** * Represents a mentionable select menu component @@ -8,4 +8,4 @@ const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); */ class MentionableSelectMenuComponent extends BaseSelectMenuComponent {} -module.exports = MentionableSelectMenuComponent; +exports.MentionableSelectMenuComponent = MentionableSelectMenuComponent; diff --git a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js index 416d5ceb5429a..86f5002520902 100644 --- a/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/MentionableSelectMenuInteraction.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const MessageComponentInteraction = require('./MessageComponentInteraction'); -const Events = require('../util/Events'); +const { MessageComponentInteraction } = require('./MessageComponentInteraction'); +const { Events } = require('../util/Events'); /** * Represents a {@link ComponentType.MentionableSelect} select menu interaction. @@ -68,4 +68,4 @@ class MentionableSelectMenuInteraction extends MessageComponentInteraction { } } -module.exports = MentionableSelectMenuInteraction; +exports.MentionableSelectMenuInteraction = MentionableSelectMenuInteraction; diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index 8bf1222c1c3e1..f8af2ae663b10 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -10,22 +10,22 @@ const { MessageFlags, PermissionFlagsBits, } = require('discord-api-types/v10'); -const Attachment = require('./Attachment'); -const Base = require('./Base'); -const ClientApplication = require('./ClientApplication'); -const Embed = require('./Embed'); -const InteractionCollector = require('./InteractionCollector'); -const Mentions = require('./MessageMentions'); -const MessagePayload = require('./MessagePayload'); +const { Attachment } = require('./Attachment'); +const { Base } = require('./Base'); +const { ClientApplication } = require('./ClientApplication'); +const { Embed } = require('./Embed'); +const { InteractionCollector } = require('./InteractionCollector'); +const { Mentions } = require('./MessageMentions'); +const { MessagePayload } = require('./MessagePayload'); const { Poll } = require('./Poll.js'); -const ReactionCollector = require('./ReactionCollector'); +const { ReactionCollector } = require('./ReactionCollector'); const { Sticker } = require('./Sticker'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const ReactionManager = require('../managers/ReactionManager'); +const { ReactionManager } = require('../managers/ReactionManager'); const { createComponent } = require('../util/Components'); const { NonSystemMessageTypes, MaxBulkDeletableMessageAge, UndeletableMessageTypes } = require('../util/Constants'); -const MessageFlagsBitField = require('../util/MessageFlagsBitField'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { MessageFlagsBitField } = require('../util/MessageFlagsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); const { _transformAPIMessageInteractionMetadata } = require('../util/Transformers.js'); const { cleanContent, resolvePartialEmoji, transformResolved } = require('../util/Util'); diff --git a/packages/discord.js/src/structures/MessageCollector.js b/packages/discord.js/src/structures/MessageCollector.js index 71019654172cb..27d703765a773 100644 --- a/packages/discord.js/src/structures/MessageCollector.js +++ b/packages/discord.js/src/structures/MessageCollector.js @@ -1,7 +1,7 @@ 'use strict'; -const Collector = require('./interfaces/Collector'); -const Events = require('../util/Events'); +const { Collector } = require('./interfaces/Collector'); +const { Events } = require('../util/Events'); /** * @typedef {CollectorOptions} MessageCollectorOptions @@ -143,4 +143,4 @@ class MessageCollector extends Collector { } } -module.exports = MessageCollector; +exports.MessageCollector = MessageCollector; diff --git a/packages/discord.js/src/structures/MessageComponentInteraction.js b/packages/discord.js/src/structures/MessageComponentInteraction.js index 47b31e04c12c3..01aeb17735f9e 100644 --- a/packages/discord.js/src/structures/MessageComponentInteraction.js +++ b/packages/discord.js/src/structures/MessageComponentInteraction.js @@ -1,9 +1,9 @@ 'use strict'; const { lazy } = require('@discordjs/util'); -const BaseInteraction = require('./BaseInteraction'); -const InteractionWebhook = require('./InteractionWebhook'); -const InteractionResponses = require('./interfaces/InteractionResponses'); +const { BaseInteraction } = require('./BaseInteraction'); +const { InteractionWebhook } = require('./InteractionWebhook'); +const { InteractionResponses } = require('./interfaces/InteractionResponses'); const getMessage = lazy(() => require('./Message').Message); @@ -104,4 +104,4 @@ class MessageComponentInteraction extends BaseInteraction { InteractionResponses.applyToClass(MessageComponentInteraction); -module.exports = MessageComponentInteraction; +exports.MessageComponentInteraction = MessageComponentInteraction; diff --git a/packages/discord.js/src/structures/MessageContextMenuCommandInteraction.js b/packages/discord.js/src/structures/MessageContextMenuCommandInteraction.js index 11005914571f9..d72ccf9f35f2c 100644 --- a/packages/discord.js/src/structures/MessageContextMenuCommandInteraction.js +++ b/packages/discord.js/src/structures/MessageContextMenuCommandInteraction.js @@ -1,6 +1,6 @@ 'use strict'; -const ContextMenuCommandInteraction = require('./ContextMenuCommandInteraction'); +const { ContextMenuCommandInteraction } = require('./ContextMenuCommandInteraction'); /** * Represents a message context menu interaction. @@ -17,4 +17,4 @@ class MessageContextMenuCommandInteraction extends ContextMenuCommandInteraction } } -module.exports = MessageContextMenuCommandInteraction; +exports.MessageContextMenuCommandInteraction = MessageContextMenuCommandInteraction; diff --git a/packages/discord.js/src/structures/MessageMentions.js b/packages/discord.js/src/structures/MessageMentions.js index dd514db8536d0..5e15dc52bb939 100644 --- a/packages/discord.js/src/structures/MessageMentions.js +++ b/packages/discord.js/src/structures/MessageMentions.js @@ -294,4 +294,4 @@ class MessageMentions { } } -module.exports = MessageMentions; +exports.MessageMentions = MessageMentions; diff --git a/packages/discord.js/src/structures/MessagePayload.js b/packages/discord.js/src/structures/MessagePayload.js index 7dc567924ba3c..b93754737f984 100644 --- a/packages/discord.js/src/structures/MessagePayload.js +++ b/packages/discord.js/src/structures/MessagePayload.js @@ -3,10 +3,10 @@ const { Buffer } = require('node:buffer'); const { isJSONEncodable } = require('@discordjs/util'); const { DiscordSnowflake } = require('@sapphire/snowflake'); -const ActionRowBuilder = require('./ActionRowBuilder'); +const { ActionRowBuilder } = require('./ActionRowBuilder'); const { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require('../errors'); const { resolveFile } = require('../util/DataResolver'); -const MessageFlagsBitField = require('../util/MessageFlagsBitField'); +const { MessageFlagsBitField } = require('../util/MessageFlagsBitField'); const { basename, verifyString, resolvePartialEmoji } = require('../util/Util'); /** @@ -49,8 +49,8 @@ class MessagePayload { * @readonly */ get isWebhook() { - const Webhook = require('./Webhook'); - const WebhookClient = require('../client/WebhookClient'); + const { Webhook } = require('./Webhook'); + const { WebhookClient } = require('../client/WebhookClient'); return this.target instanceof Webhook || this.target instanceof WebhookClient; } @@ -60,7 +60,7 @@ class MessagePayload { * @readonly */ get isUser() { - const User = require('./User'); + const { User } = require('./User'); const { GuildMember } = require('./GuildMember'); return this.target instanceof User || this.target instanceof GuildMember; } @@ -81,7 +81,7 @@ class MessagePayload { * @readonly */ get isMessageManager() { - const MessageManager = require('../managers/MessageManager'); + const { MessageManager } = require('../managers/MessageManager'); return this.target instanceof MessageManager; } @@ -291,7 +291,7 @@ class MessagePayload { } } -module.exports = MessagePayload; +exports.MessagePayload = MessagePayload; /** * A target for a message. diff --git a/packages/discord.js/src/structures/MessageReaction.js b/packages/discord.js/src/structures/MessageReaction.js index 15c53b78fa6b5..2fdd760ac0bc9 100644 --- a/packages/discord.js/src/structures/MessageReaction.js +++ b/packages/discord.js/src/structures/MessageReaction.js @@ -1,10 +1,10 @@ 'use strict'; const { Routes } = require('discord-api-types/v10'); -const ApplicationEmoji = require('./ApplicationEmoji'); -const GuildEmoji = require('./GuildEmoji'); -const ReactionEmoji = require('./ReactionEmoji'); -const ReactionUserManager = require('../managers/ReactionUserManager'); +const { ApplicationEmoji } = require('./ApplicationEmoji'); +const { GuildEmoji } = require('./GuildEmoji'); +const { ReactionEmoji } = require('./ReactionEmoji'); +const { ReactionUserManager } = require('../managers/ReactionUserManager'); const { flatten } = require('../util/Util'); /** @@ -197,4 +197,4 @@ class MessageReaction { } } -module.exports = MessageReaction; +exports.MessageReaction = MessageReaction; diff --git a/packages/discord.js/src/structures/ModalBuilder.js b/packages/discord.js/src/structures/ModalBuilder.js index fa45b847897eb..2f2dbe22f5686 100644 --- a/packages/discord.js/src/structures/ModalBuilder.js +++ b/packages/discord.js/src/structures/ModalBuilder.js @@ -28,7 +28,7 @@ class ModalBuilder extends BuildersModal { } } -module.exports = ModalBuilder; +exports.ModalBuilder = ModalBuilder; /** * @external BuildersModal diff --git a/packages/discord.js/src/structures/ModalSubmitFields.js b/packages/discord.js/src/structures/ModalSubmitFields.js index a2f691f3ae9c2..5ddad168bde65 100644 --- a/packages/discord.js/src/structures/ModalSubmitFields.js +++ b/packages/discord.js/src/structures/ModalSubmitFields.js @@ -52,4 +52,4 @@ class ModalSubmitFields { } } -module.exports = ModalSubmitFields; +exports.ModalSubmitFields = ModalSubmitFields; diff --git a/packages/discord.js/src/structures/ModalSubmitInteraction.js b/packages/discord.js/src/structures/ModalSubmitInteraction.js index 559807bfa0783..c11298746c484 100644 --- a/packages/discord.js/src/structures/ModalSubmitInteraction.js +++ b/packages/discord.js/src/structures/ModalSubmitInteraction.js @@ -1,10 +1,10 @@ 'use strict'; const { lazy } = require('@discordjs/util'); -const BaseInteraction = require('./BaseInteraction'); -const InteractionWebhook = require('./InteractionWebhook'); -const ModalSubmitFields = require('./ModalSubmitFields'); -const InteractionResponses = require('./interfaces/InteractionResponses'); +const { BaseInteraction } = require('./BaseInteraction'); +const { InteractionWebhook } = require('./InteractionWebhook'); +const { ModalSubmitFields } = require('./ModalSubmitFields'); +const { InteractionResponses } = require('./interfaces/InteractionResponses'); const getMessage = lazy(() => require('./Message').Message); @@ -122,4 +122,4 @@ class ModalSubmitInteraction extends BaseInteraction { InteractionResponses.applyToClass(ModalSubmitInteraction, 'showModal'); -module.exports = ModalSubmitInteraction; +exports.ModalSubmitInteraction = ModalSubmitInteraction; diff --git a/packages/discord.js/src/structures/OAuth2Guild.js b/packages/discord.js/src/structures/OAuth2Guild.js index d5104ac7a6589..7ebb4dc0bc642 100644 --- a/packages/discord.js/src/structures/OAuth2Guild.js +++ b/packages/discord.js/src/structures/OAuth2Guild.js @@ -1,7 +1,7 @@ 'use strict'; -const BaseGuild = require('./BaseGuild'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { BaseGuild } = require('./BaseGuild'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * A partial guild received when using {@link GuildManager#fetch} to fetch multiple guilds. @@ -25,4 +25,4 @@ class OAuth2Guild extends BaseGuild { } } -module.exports = OAuth2Guild; +exports.OAuth2Guild = OAuth2Guild; diff --git a/packages/discord.js/src/structures/PartialGroupDMChannel.js b/packages/discord.js/src/structures/PartialGroupDMChannel.js index 704c8655753ce..aa6d9d8b9cd33 100644 --- a/packages/discord.js/src/structures/PartialGroupDMChannel.js +++ b/packages/discord.js/src/structures/PartialGroupDMChannel.js @@ -2,7 +2,7 @@ const { BaseChannel } = require('./BaseChannel'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const PartialGroupDMMessageManager = require('../managers/PartialGroupDMMessageManager'); +const { PartialGroupDMMessageManager } = require('../managers/PartialGroupDMMessageManager'); /** * Represents a Partial Group DM Channel on Discord. @@ -64,4 +64,4 @@ class PartialGroupDMChannel extends BaseChannel { } } -module.exports = PartialGroupDMChannel; +exports.PartialGroupDMChannel = PartialGroupDMChannel; diff --git a/packages/discord.js/src/structures/PermissionOverwrites.js b/packages/discord.js/src/structures/PermissionOverwrites.js index f8d81c87f5e56..128714ec591a0 100644 --- a/packages/discord.js/src/structures/PermissionOverwrites.js +++ b/packages/discord.js/src/structures/PermissionOverwrites.js @@ -1,10 +1,10 @@ 'use strict'; const { OverwriteType } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { Role } = require('./Role'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); -const PermissionsBitField = require('../util/PermissionsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); /** * Represents a permission overwrite for a role or member in a guild channel. @@ -193,4 +193,4 @@ class PermissionOverwrites extends Base { } } -module.exports = PermissionOverwrites; +exports.PermissionOverwrites = PermissionOverwrites; diff --git a/packages/discord.js/src/structures/Poll.js b/packages/discord.js/src/structures/Poll.js index 90c1f5af0b0f3..cdc628c5a6346 100644 --- a/packages/discord.js/src/structures/Poll.js +++ b/packages/discord.js/src/structures/Poll.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { PollAnswer } = require('./PollAnswer'); const { DiscordjsError } = require('../errors/DJSError'); const { ErrorCodes } = require('../errors/index'); diff --git a/packages/discord.js/src/structures/PollAnswer.js b/packages/discord.js/src/structures/PollAnswer.js index af3db7a5298b4..30152a69750dc 100644 --- a/packages/discord.js/src/structures/PollAnswer.js +++ b/packages/discord.js/src/structures/PollAnswer.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); const { Emoji } = require('./Emoji'); /** diff --git a/packages/discord.js/src/structures/Presence.js b/packages/discord.js/src/structures/Presence.js index c1d945fe3b060..6a7dd29ef2a02 100644 --- a/packages/discord.js/src/structures/Presence.js +++ b/packages/discord.js/src/structures/Presence.js @@ -1,8 +1,8 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); const { Emoji } = require('./Emoji'); -const ActivityFlagsBitField = require('../util/ActivityFlagsBitField'); +const { ActivityFlagsBitField } = require('../util/ActivityFlagsBitField'); const { flatten } = require('../util/Util'); /** diff --git a/packages/discord.js/src/structures/ReactionCollector.js b/packages/discord.js/src/structures/ReactionCollector.js index 8a0ca9063d514..58b3168b80ef1 100644 --- a/packages/discord.js/src/structures/ReactionCollector.js +++ b/packages/discord.js/src/structures/ReactionCollector.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const Collector = require('./interfaces/Collector'); -const Events = require('../util/Events'); +const { Collector } = require('./interfaces/Collector'); +const { Events } = require('../util/Events'); /** * @typedef {CollectorOptions} ReactionCollectorOptions @@ -226,4 +226,4 @@ class ReactionCollector extends Collector { } } -module.exports = ReactionCollector; +exports.ReactionCollector = ReactionCollector; diff --git a/packages/discord.js/src/structures/ReactionEmoji.js b/packages/discord.js/src/structures/ReactionEmoji.js index 08e2ea025311c..b193660842a97 100644 --- a/packages/discord.js/src/structures/ReactionEmoji.js +++ b/packages/discord.js/src/structures/ReactionEmoji.js @@ -28,4 +28,4 @@ class ReactionEmoji extends Emoji { } } -module.exports = ReactionEmoji; +exports.ReactionEmoji = ReactionEmoji; diff --git a/packages/discord.js/src/structures/Role.js b/packages/discord.js/src/structures/Role.js index 06cbac60bade5..1a59d4267f0ec 100644 --- a/packages/discord.js/src/structures/Role.js +++ b/packages/discord.js/src/structures/Role.js @@ -3,10 +3,10 @@ const { roleMention } = require('@discordjs/formatters'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { PermissionFlagsBits } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { DiscordjsError, ErrorCodes } = require('../errors'); -const PermissionsBitField = require('../util/PermissionsBitField'); -const RoleFlagsBitField = require('../util/RoleFlagsBitField'); +const { PermissionsBitField } = require('../util/PermissionsBitField'); +const { RoleFlagsBitField } = require('../util/RoleFlagsBitField'); /** * Represents a role on Discord. diff --git a/packages/discord.js/src/structures/RoleSelectMenuBuilder.js b/packages/discord.js/src/structures/RoleSelectMenuBuilder.js index 0d80de5ba9b02..03904bc21862b 100644 --- a/packages/discord.js/src/structures/RoleSelectMenuBuilder.js +++ b/packages/discord.js/src/structures/RoleSelectMenuBuilder.js @@ -23,7 +23,7 @@ class RoleSelectMenuBuilder extends BuildersRoleSelectMenu { } } -module.exports = RoleSelectMenuBuilder; +exports.RoleSelectMenuBuilder = RoleSelectMenuBuilder; /** * @external BuildersRoleSelectMenu diff --git a/packages/discord.js/src/structures/RoleSelectMenuComponent.js b/packages/discord.js/src/structures/RoleSelectMenuComponent.js index 1b279428d57c4..cdf876e414e3c 100644 --- a/packages/discord.js/src/structures/RoleSelectMenuComponent.js +++ b/packages/discord.js/src/structures/RoleSelectMenuComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); +const { BaseSelectMenuComponent } = require('./BaseSelectMenuComponent'); /** * Represents a role select menu component @@ -8,4 +8,4 @@ const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); */ class RoleSelectMenuComponent extends BaseSelectMenuComponent {} -module.exports = RoleSelectMenuComponent; +exports.RoleSelectMenuComponent = RoleSelectMenuComponent; diff --git a/packages/discord.js/src/structures/RoleSelectMenuInteraction.js b/packages/discord.js/src/structures/RoleSelectMenuInteraction.js index eb42eff2351e0..fa39dc3997f49 100644 --- a/packages/discord.js/src/structures/RoleSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/RoleSelectMenuInteraction.js @@ -1,7 +1,7 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const MessageComponentInteraction = require('./MessageComponentInteraction'); +const { MessageComponentInteraction } = require('./MessageComponentInteraction'); /** * Represents a {@link ComponentType.RoleSelect} select menu interaction. @@ -30,4 +30,4 @@ class RoleSelectMenuInteraction extends MessageComponentInteraction { } } -module.exports = RoleSelectMenuInteraction; +exports.RoleSelectMenuInteraction = RoleSelectMenuInteraction; diff --git a/packages/discord.js/src/structures/SKU.js b/packages/discord.js/src/structures/SKU.js index 3ce4eeba3704d..ef87b977a51ee 100644 --- a/packages/discord.js/src/structures/SKU.js +++ b/packages/discord.js/src/structures/SKU.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); const { SKUFlagsBitField } = require('../util/SKUFlagsBitField'); /** diff --git a/packages/discord.js/src/structures/StageChannel.js b/packages/discord.js/src/structures/StageChannel.js index 26614895e2543..41c5e4f6efed2 100644 --- a/packages/discord.js/src/structures/StageChannel.js +++ b/packages/discord.js/src/structures/StageChannel.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseGuildVoiceChannel = require('./BaseGuildVoiceChannel'); +const { BaseGuildVoiceChannel } = require('./BaseGuildVoiceChannel'); /** * Represents a guild stage channel on Discord. @@ -109,4 +109,4 @@ class StageChannel extends BaseGuildVoiceChannel { * @returns {Promise} */ -module.exports = StageChannel; +exports.StageChannel = StageChannel; diff --git a/packages/discord.js/src/structures/StageInstance.js b/packages/discord.js/src/structures/StageInstance.js index 632f7b0c78d88..2c3e44de22082 100644 --- a/packages/discord.js/src/structures/StageInstance.js +++ b/packages/discord.js/src/structures/StageInstance.js @@ -1,7 +1,7 @@ 'use strict'; const { DiscordSnowflake } = require('@sapphire/snowflake'); -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents a stage instance. diff --git a/packages/discord.js/src/structures/Sticker.js b/packages/discord.js/src/structures/Sticker.js index 58f22b72741b5..ce1d24bc27866 100644 --- a/packages/discord.js/src/structures/Sticker.js +++ b/packages/discord.js/src/structures/Sticker.js @@ -2,7 +2,7 @@ const { DiscordSnowflake } = require('@sapphire/snowflake'); const { Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { DiscordjsError, ErrorCodes } = require('../errors'); const { StickerFormatExtensionMap } = require('../util/Constants'); diff --git a/packages/discord.js/src/structures/StickerPack.js b/packages/discord.js/src/structures/StickerPack.js index 45226b3d6b966..02e2f28418ae0 100644 --- a/packages/discord.js/src/structures/StickerPack.js +++ b/packages/discord.js/src/structures/StickerPack.js @@ -2,7 +2,7 @@ const { Collection } = require('@discordjs/collection'); const { DiscordSnowflake } = require('@sapphire/snowflake'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { Sticker } = require('./Sticker'); /** @@ -92,4 +92,4 @@ class StickerPack extends Base { } } -module.exports = StickerPack; +exports.StickerPack = StickerPack; diff --git a/packages/discord.js/src/structures/StringSelectMenuBuilder.js b/packages/discord.js/src/structures/StringSelectMenuBuilder.js index bd123e4af8e62..d06d965d1148e 100644 --- a/packages/discord.js/src/structures/StringSelectMenuBuilder.js +++ b/packages/discord.js/src/structures/StringSelectMenuBuilder.js @@ -71,7 +71,7 @@ class StringSelectMenuBuilder extends BuildersSelectMenu { } } -module.exports = StringSelectMenuBuilder; +exports.StringSelectMenuBuilder = StringSelectMenuBuilder; /** * @external BuildersSelectMenu diff --git a/packages/discord.js/src/structures/StringSelectMenuComponent.js b/packages/discord.js/src/structures/StringSelectMenuComponent.js index e008ae5f2b082..6b5fca041ee2a 100644 --- a/packages/discord.js/src/structures/StringSelectMenuComponent.js +++ b/packages/discord.js/src/structures/StringSelectMenuComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); +const { BaseSelectMenuComponent } = require('./BaseSelectMenuComponent'); /** * Represents a string select menu component @@ -17,4 +17,4 @@ class StringSelectMenuComponent extends BaseSelectMenuComponent { } } -module.exports = StringSelectMenuComponent; +exports.StringSelectMenuComponent = StringSelectMenuComponent; diff --git a/packages/discord.js/src/structures/StringSelectMenuInteraction.js b/packages/discord.js/src/structures/StringSelectMenuInteraction.js index 1db8c28f6711e..0d7a515e43acf 100644 --- a/packages/discord.js/src/structures/StringSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/StringSelectMenuInteraction.js @@ -1,6 +1,6 @@ 'use strict'; -const MessageComponentInteraction = require('./MessageComponentInteraction'); +const { MessageComponentInteraction } = require('./MessageComponentInteraction'); /** * Represents a {@link ComponentType.StringSelect} select menu interaction. @@ -18,4 +18,4 @@ class StringSelectMenuInteraction extends MessageComponentInteraction { } } -module.exports = StringSelectMenuInteraction; +exports.StringSelectMenuInteraction = StringSelectMenuInteraction; diff --git a/packages/discord.js/src/structures/StringSelectMenuOptionBuilder.js b/packages/discord.js/src/structures/StringSelectMenuOptionBuilder.js index cc85750923191..59e6f7f653cab 100644 --- a/packages/discord.js/src/structures/StringSelectMenuOptionBuilder.js +++ b/packages/discord.js/src/structures/StringSelectMenuOptionBuilder.js @@ -41,7 +41,7 @@ class StringSelectMenuOptionBuilder extends BuildersSelectMenuOption { } } -module.exports = StringSelectMenuOptionBuilder; +exports.StringSelectMenuOptionBuilder = StringSelectMenuOptionBuilder; /** * @external BuildersSelectMenuOption diff --git a/packages/discord.js/src/structures/Subscription.js b/packages/discord.js/src/structures/Subscription.js index 9a1766024d5cf..2c8c7660a1b39 100644 --- a/packages/discord.js/src/structures/Subscription.js +++ b/packages/discord.js/src/structures/Subscription.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents a Subscription diff --git a/packages/discord.js/src/structures/Team.js b/packages/discord.js/src/structures/Team.js index 98eb199c22a07..7d588a79287f9 100644 --- a/packages/discord.js/src/structures/Team.js +++ b/packages/discord.js/src/structures/Team.js @@ -2,8 +2,8 @@ const { Collection } = require('@discordjs/collection'); const { DiscordSnowflake } = require('@sapphire/snowflake'); -const Base = require('./Base'); -const TeamMember = require('./TeamMember'); +const { Base } = require('./Base'); +const { TeamMember } = require('./TeamMember'); /** * Represents a Client OAuth2 Application Team. @@ -114,4 +114,4 @@ class Team extends Base { } } -module.exports = Team; +exports.Team = Team; diff --git a/packages/discord.js/src/structures/TeamMember.js b/packages/discord.js/src/structures/TeamMember.js index b289ccd72677f..29ec774e82087 100644 --- a/packages/discord.js/src/structures/TeamMember.js +++ b/packages/discord.js/src/structures/TeamMember.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents a Client OAuth2 Application Team Member. @@ -67,4 +67,4 @@ class TeamMember extends Base { } } -module.exports = TeamMember; +exports.TeamMember = TeamMember; diff --git a/packages/discord.js/src/structures/TextChannel.js b/packages/discord.js/src/structures/TextChannel.js index 66cc8c4502bfb..206645e633932 100644 --- a/packages/discord.js/src/structures/TextChannel.js +++ b/packages/discord.js/src/structures/TextChannel.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseGuildTextChannel = require('./BaseGuildTextChannel'); +const { BaseGuildTextChannel } = require('./BaseGuildTextChannel'); /** * Represents a guild text channel on Discord. @@ -30,4 +30,4 @@ class TextChannel extends BaseGuildTextChannel { } } -module.exports = TextChannel; +exports.TextChannel = TextChannel; diff --git a/packages/discord.js/src/structures/TextInputBuilder.js b/packages/discord.js/src/structures/TextInputBuilder.js index 938215495b638..ed3c70630281a 100644 --- a/packages/discord.js/src/structures/TextInputBuilder.js +++ b/packages/discord.js/src/structures/TextInputBuilder.js @@ -23,7 +23,7 @@ class TextInputBuilder extends BuildersTextInput { } } -module.exports = TextInputBuilder; +exports.TextInputBuilder = TextInputBuilder; /** * @external BuildersTextInput diff --git a/packages/discord.js/src/structures/TextInputComponent.js b/packages/discord.js/src/structures/TextInputComponent.js index 3cc311575b8cf..a9a09ca0b49e0 100644 --- a/packages/discord.js/src/structures/TextInputComponent.js +++ b/packages/discord.js/src/structures/TextInputComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const Component = require('./Component'); +const { Component } = require('./Component'); /** * Represents a text input component. @@ -26,4 +26,4 @@ class TextInputComponent extends Component { } } -module.exports = TextInputComponent; +exports.TextInputComponent = TextInputComponent; diff --git a/packages/discord.js/src/structures/ThreadChannel.js b/packages/discord.js/src/structures/ThreadChannel.js index d3b92dd80592b..59cafe9c9ab39 100644 --- a/packages/discord.js/src/structures/ThreadChannel.js +++ b/packages/discord.js/src/structures/ThreadChannel.js @@ -4,11 +4,11 @@ const { lazy } = require('@discordjs/util'); const { ChannelFlags, ChannelType, PermissionFlagsBits, Routes } = require('discord-api-types/v10'); const { BaseChannel } = require('./BaseChannel'); const getThreadOnlyChannel = lazy(() => require('./ThreadOnlyChannel')); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); const { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require('../errors'); -const GuildMessageManager = require('../managers/GuildMessageManager'); -const ThreadMemberManager = require('../managers/ThreadMemberManager'); -const ChannelFlagsBitField = require('../util/ChannelFlagsBitField'); +const { GuildMessageManager } = require('../managers/GuildMessageManager'); +const { ThreadMemberManager } = require('../managers/ThreadMemberManager'); +const { ChannelFlagsBitField } = require('../util/ChannelFlagsBitField'); /** * Represents a thread channel on Discord. @@ -609,4 +609,4 @@ class ThreadChannel extends BaseChannel { TextBasedChannel.applyToClass(ThreadChannel, true, ['fetchWebhooks', 'setRateLimitPerUser', 'setNSFW']); -module.exports = ThreadChannel; +exports.ThreadChannel = ThreadChannel; diff --git a/packages/discord.js/src/structures/ThreadMember.js b/packages/discord.js/src/structures/ThreadMember.js index d828a2af68549..cf03b22df1d23 100644 --- a/packages/discord.js/src/structures/ThreadMember.js +++ b/packages/discord.js/src/structures/ThreadMember.js @@ -1,7 +1,7 @@ 'use strict'; -const Base = require('./Base'); -const ThreadMemberFlagsBitField = require('../util/ThreadMemberFlagsBitField'); +const { Base } = require('./Base'); +const { ThreadMemberFlagsBitField } = require('../util/ThreadMemberFlagsBitField'); /** * Represents a Member for a Thread. @@ -109,4 +109,4 @@ class ThreadMember extends Base { } } -module.exports = ThreadMember; +exports.ThreadMember = ThreadMember; diff --git a/packages/discord.js/src/structures/ThreadOnlyChannel.js b/packages/discord.js/src/structures/ThreadOnlyChannel.js index 0445b9988e9ee..04b73be25dd06 100644 --- a/packages/discord.js/src/structures/ThreadOnlyChannel.js +++ b/packages/discord.js/src/structures/ThreadOnlyChannel.js @@ -1,8 +1,8 @@ 'use strict'; -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const GuildForumThreadManager = require('../managers/GuildForumThreadManager'); +const { GuildChannel } = require('./GuildChannel'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); +const { GuildForumThreadManager } = require('../managers/GuildForumThreadManager'); const { transformAPIGuildForumTag, transformAPIGuildDefaultReaction } = require('../util/Channels'); /** @@ -246,4 +246,4 @@ TextBasedChannel.applyToClass(ThreadOnlyChannel, true, [ 'awaitMessageComponent', ]); -module.exports = ThreadOnlyChannel; +exports.ThreadOnlyChannel = ThreadOnlyChannel; diff --git a/packages/discord.js/src/structures/Typing.js b/packages/discord.js/src/structures/Typing.js index 341d7cad396ea..b421b4cb0498f 100644 --- a/packages/discord.js/src/structures/Typing.js +++ b/packages/discord.js/src/structures/Typing.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents a typing state for a user in a channel. @@ -71,4 +71,4 @@ class Typing extends Base { } } -module.exports = Typing; +exports.Typing = Typing; diff --git a/packages/discord.js/src/structures/User.js b/packages/discord.js/src/structures/User.js index 6025410c30f19..de9a3c4d0da1e 100644 --- a/packages/discord.js/src/structures/User.js +++ b/packages/discord.js/src/structures/User.js @@ -3,9 +3,9 @@ const { userMention } = require('@discordjs/formatters'); const { calculateUserDefaultAvatarIndex } = require('@discordjs/rest'); const { DiscordSnowflake } = require('@sapphire/snowflake'); -const Base = require('./Base'); -const TextBasedChannel = require('./interfaces/TextBasedChannel'); -const UserFlagsBitField = require('../util/UserFlagsBitField'); +const { Base } = require('./Base'); +const { TextBasedChannel } = require('./interfaces/TextBasedChannel'); +const { UserFlagsBitField } = require('../util/UserFlagsBitField'); /** * Represents a user on Discord. @@ -377,4 +377,4 @@ class User extends Base { TextBasedChannel.applyToClass(User); -module.exports = User; +exports.User = User; diff --git a/packages/discord.js/src/structures/UserContextMenuCommandInteraction.js b/packages/discord.js/src/structures/UserContextMenuCommandInteraction.js index 2e9dc7c628778..39ad706d87832 100644 --- a/packages/discord.js/src/structures/UserContextMenuCommandInteraction.js +++ b/packages/discord.js/src/structures/UserContextMenuCommandInteraction.js @@ -1,6 +1,6 @@ 'use strict'; -const ContextMenuCommandInteraction = require('./ContextMenuCommandInteraction'); +const { ContextMenuCommandInteraction } = require('./ContextMenuCommandInteraction'); /** * Represents a user context menu interaction. @@ -26,4 +26,4 @@ class UserContextMenuCommandInteraction extends ContextMenuCommandInteraction { } } -module.exports = UserContextMenuCommandInteraction; +exports.UserContextMenuCommandInteraction = UserContextMenuCommandInteraction; diff --git a/packages/discord.js/src/structures/UserSelectMenuBuilder.js b/packages/discord.js/src/structures/UserSelectMenuBuilder.js index 61bdbb802fdca..e3f266e6d5394 100644 --- a/packages/discord.js/src/structures/UserSelectMenuBuilder.js +++ b/packages/discord.js/src/structures/UserSelectMenuBuilder.js @@ -23,7 +23,7 @@ class UserSelectMenuBuilder extends BuildersUserSelectMenu { } } -module.exports = UserSelectMenuBuilder; +exports.UserSelectMenuBuilder = UserSelectMenuBuilder; /** * @external BuildersUserSelectMenu diff --git a/packages/discord.js/src/structures/UserSelectMenuComponent.js b/packages/discord.js/src/structures/UserSelectMenuComponent.js index 0acacdfab2e53..8e280129c5255 100644 --- a/packages/discord.js/src/structures/UserSelectMenuComponent.js +++ b/packages/discord.js/src/structures/UserSelectMenuComponent.js @@ -1,6 +1,6 @@ 'use strict'; -const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); +const { BaseSelectMenuComponent } = require('./BaseSelectMenuComponent'); /** * Represents a user select menu component @@ -8,4 +8,4 @@ const BaseSelectMenuComponent = require('./BaseSelectMenuComponent'); */ class UserSelectMenuComponent extends BaseSelectMenuComponent {} -module.exports = UserSelectMenuComponent; +exports.UserSelectMenuComponent = UserSelectMenuComponent; diff --git a/packages/discord.js/src/structures/UserSelectMenuInteraction.js b/packages/discord.js/src/structures/UserSelectMenuInteraction.js index 5e232399708e0..4c26e612cfea9 100644 --- a/packages/discord.js/src/structures/UserSelectMenuInteraction.js +++ b/packages/discord.js/src/structures/UserSelectMenuInteraction.js @@ -1,8 +1,8 @@ 'use strict'; const { Collection } = require('@discordjs/collection'); -const MessageComponentInteraction = require('./MessageComponentInteraction'); -const Events = require('../util/Events'); +const { MessageComponentInteraction } = require('./MessageComponentInteraction'); +const { Events } = require('../util/Events'); /** * Represents a {@link ComponentType.UserSelect} select menu interaction. @@ -48,4 +48,4 @@ class UserSelectMenuInteraction extends MessageComponentInteraction { } } -module.exports = UserSelectMenuInteraction; +exports.UserSelectMenuInteraction = UserSelectMenuInteraction; diff --git a/packages/discord.js/src/structures/VoiceChannel.js b/packages/discord.js/src/structures/VoiceChannel.js index d4f33ca1224b0..1e6c5378c594f 100644 --- a/packages/discord.js/src/structures/VoiceChannel.js +++ b/packages/discord.js/src/structures/VoiceChannel.js @@ -1,7 +1,7 @@ 'use strict'; const { PermissionFlagsBits } = require('discord-api-types/v10'); -const BaseGuildVoiceChannel = require('./BaseGuildVoiceChannel'); +const { BaseGuildVoiceChannel } = require('./BaseGuildVoiceChannel'); /** * Represents a guild voice channel on Discord. @@ -93,4 +93,4 @@ class VoiceChannel extends BaseGuildVoiceChannel { * @returns {Promise} */ -module.exports = VoiceChannel; +exports.VoiceChannel = VoiceChannel; diff --git a/packages/discord.js/src/structures/VoiceChannelEffect.js b/packages/discord.js/src/structures/VoiceChannelEffect.js index ee42ea6f72b97..104fb1a088724 100644 --- a/packages/discord.js/src/structures/VoiceChannelEffect.js +++ b/packages/discord.js/src/structures/VoiceChannelEffect.js @@ -66,4 +66,4 @@ class VoiceChannelEffect { } } -module.exports = VoiceChannelEffect; +exports.VoiceChannelEffect = VoiceChannelEffect; diff --git a/packages/discord.js/src/structures/VoiceRegion.js b/packages/discord.js/src/structures/VoiceRegion.js index 1f5652a2c9e15..3dadfc64ba184 100644 --- a/packages/discord.js/src/structures/VoiceRegion.js +++ b/packages/discord.js/src/structures/VoiceRegion.js @@ -43,4 +43,4 @@ class VoiceRegion { } } -module.exports = VoiceRegion; +exports.VoiceRegion = VoiceRegion; diff --git a/packages/discord.js/src/structures/VoiceState.js b/packages/discord.js/src/structures/VoiceState.js index 890681e53a0ec..8f4bea95ca49e 100644 --- a/packages/discord.js/src/structures/VoiceState.js +++ b/packages/discord.js/src/structures/VoiceState.js @@ -1,7 +1,7 @@ 'use strict'; const { ChannelType, Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); +const { Base } = require('./Base'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); /** @@ -309,4 +309,4 @@ class VoiceState extends Base { } } -module.exports = VoiceState; +exports.VoiceState = VoiceState; diff --git a/packages/discord.js/src/structures/Webhook.js b/packages/discord.js/src/structures/Webhook.js index b8302454a7ed6..2cb7fe1c52f15 100644 --- a/packages/discord.js/src/structures/Webhook.js +++ b/packages/discord.js/src/structures/Webhook.js @@ -4,7 +4,7 @@ const { makeURLSearchParams } = require('@discordjs/rest'); const { lazy } = require('@discordjs/util'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const { Routes, WebhookType } = require('discord-api-types/v10'); -const MessagePayload = require('./MessagePayload'); +const { MessagePayload } = require('./MessagePayload'); const { DiscordjsError, ErrorCodes } = require('../errors'); const { resolveImage } = require('../util/DataResolver'); @@ -478,4 +478,4 @@ class Webhook { } } -module.exports = Webhook; +exports.Webhook = Webhook; diff --git a/packages/discord.js/src/structures/WelcomeChannel.js b/packages/discord.js/src/structures/WelcomeChannel.js index 6ddcdbb28f327..e36c747bb6160 100644 --- a/packages/discord.js/src/structures/WelcomeChannel.js +++ b/packages/discord.js/src/structures/WelcomeChannel.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); const { Emoji } = require('./Emoji'); /** @@ -57,4 +57,4 @@ class WelcomeChannel extends Base { } } -module.exports = WelcomeChannel; +exports.WelcomeChannel = WelcomeChannel; diff --git a/packages/discord.js/src/structures/WelcomeScreen.js b/packages/discord.js/src/structures/WelcomeScreen.js index 9ff79bc82bcb7..9d68cdc146c52 100644 --- a/packages/discord.js/src/structures/WelcomeScreen.js +++ b/packages/discord.js/src/structures/WelcomeScreen.js @@ -2,8 +2,8 @@ const { Collection } = require('@discordjs/collection'); const { GuildFeature } = require('discord-api-types/v10'); -const Base = require('./Base'); -const WelcomeChannel = require('./WelcomeChannel'); +const { Base } = require('./Base'); +const { WelcomeChannel } = require('./WelcomeChannel'); /** * Represents a welcome screen. @@ -46,4 +46,4 @@ class WelcomeScreen extends Base { } } -module.exports = WelcomeScreen; +exports.WelcomeScreen = WelcomeScreen; diff --git a/packages/discord.js/src/structures/Widget.js b/packages/discord.js/src/structures/Widget.js index e082fd5bde201..9e08ae18fc478 100644 --- a/packages/discord.js/src/structures/Widget.js +++ b/packages/discord.js/src/structures/Widget.js @@ -2,8 +2,8 @@ const { Collection } = require('@discordjs/collection'); const { Routes } = require('discord-api-types/v10'); -const Base = require('./Base'); -const WidgetMember = require('./WidgetMember'); +const { Base } = require('./Base'); +const { WidgetMember } = require('./WidgetMember'); /** * Represents a Widget. @@ -94,4 +94,4 @@ class Widget extends Base { } } -module.exports = Widget; +exports.Widget = Widget; diff --git a/packages/discord.js/src/structures/WidgetMember.js b/packages/discord.js/src/structures/WidgetMember.js index d7aca2172540b..d7df2070faf20 100644 --- a/packages/discord.js/src/structures/WidgetMember.js +++ b/packages/discord.js/src/structures/WidgetMember.js @@ -1,6 +1,6 @@ 'use strict'; -const Base = require('./Base'); +const { Base } = require('./Base'); /** * Represents a WidgetMember. @@ -96,4 +96,4 @@ class WidgetMember extends Base { } } -module.exports = WidgetMember; +exports.WidgetMember = WidgetMember; diff --git a/packages/discord.js/src/structures/interfaces/Application.js b/packages/discord.js/src/structures/interfaces/Application.js index 5e81465e28bde..037b9ff8b3875 100644 --- a/packages/discord.js/src/structures/interfaces/Application.js +++ b/packages/discord.js/src/structures/interfaces/Application.js @@ -1,7 +1,7 @@ 'use strict'; const { DiscordSnowflake } = require('@sapphire/snowflake'); -const Base = require('../Base'); +const { Base } = require('../Base'); /** * Represents an OAuth2 Application. @@ -105,4 +105,4 @@ class Application extends Base { } } -module.exports = Application; +exports.Application = Application; diff --git a/packages/discord.js/src/structures/interfaces/Collector.js b/packages/discord.js/src/structures/interfaces/Collector.js index 68bccc433462e..ad5fb5f9691a5 100644 --- a/packages/discord.js/src/structures/interfaces/Collector.js +++ b/packages/discord.js/src/structures/interfaces/Collector.js @@ -332,4 +332,4 @@ class Collector extends EventEmitter { /* eslint-enable no-empty-function */ } -module.exports = Collector; +exports.Collector = Collector; diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js index 3610b2e47bdd6..c8c5348e90032 100644 --- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js +++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js @@ -4,10 +4,10 @@ const { makeURLSearchParams } = require('@discordjs/rest'); const { isJSONEncodable } = require('@discordjs/util'); const { InteractionResponseType, MessageFlags, Routes, InteractionType } = require('discord-api-types/v10'); const { DiscordjsError, ErrorCodes } = require('../../errors'); -const InteractionCallbackResponse = require('../InteractionCallbackResponse'); -const InteractionCollector = require('../InteractionCollector'); -const InteractionResponse = require('../InteractionResponse'); -const MessagePayload = require('../MessagePayload'); +const { InteractionCallbackResponse } = require('../InteractionCallbackResponse'); +const { InteractionCollector } = require('../InteractionCollector'); +const { InteractionResponse } = require('../InteractionResponse'); +const { MessagePayload } = require('../MessagePayload'); /** * @typedef {Object} ModalComponentData @@ -347,4 +347,4 @@ class InteractionResponses { } } -module.exports = InteractionResponses; +exports.InteractionResponses = InteractionResponses; diff --git a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js index d2e4085802534..8252f43c8ba3c 100644 --- a/packages/discord.js/src/structures/interfaces/TextBasedChannel.js +++ b/packages/discord.js/src/structures/interfaces/TextBasedChannel.js @@ -5,9 +5,9 @@ const { DiscordSnowflake } = require('@sapphire/snowflake'); const { InteractionType, Routes } = require('discord-api-types/v10'); const { DiscordjsTypeError, DiscordjsError, ErrorCodes } = require('../../errors'); const { MaxBulkDeletableMessageAge } = require('../../util/Constants'); -const InteractionCollector = require('../InteractionCollector'); -const MessageCollector = require('../MessageCollector'); -const MessagePayload = require('../MessagePayload'); +const { InteractionCollector } = require('../InteractionCollector'); +const { MessageCollector } = require('../MessageCollector'); +const { MessagePayload } = require('../MessagePayload'); /** * Interface for classes that have text-channel-like features. @@ -162,7 +162,7 @@ class TextBasedChannel { * .catch(console.error); */ async send(options) { - const User = require('../User'); + const { User } = require('../User'); const { GuildMember } = require('../GuildMember'); if (this instanceof User || this instanceof GuildMember) { @@ -427,8 +427,8 @@ class TextBasedChannel { } } -module.exports = TextBasedChannel; +exports.TextBasedChannel = TextBasedChannel; // Fixes Circular // eslint-disable-next-line import/order -const GuildMessageManager = require('../../managers/GuildMessageManager'); +const { GuildMessageManager } = require('../../managers/GuildMessageManager'); diff --git a/packages/discord.js/src/util/ActivityFlagsBitField.js b/packages/discord.js/src/util/ActivityFlagsBitField.js index 7c0ef76a2e739..7ceb9e727e5a1 100644 --- a/packages/discord.js/src/util/ActivityFlagsBitField.js +++ b/packages/discord.js/src/util/ActivityFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { ActivityFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with an {@link Activity#flags} bitfield. @@ -23,4 +23,4 @@ class ActivityFlagsBitField extends BitField { * @param {BitFieldResolvable} [bits=0] Bit(s) to read from */ -module.exports = ActivityFlagsBitField; +exports.ActivityFlagsBitField = ActivityFlagsBitField; diff --git a/packages/discord.js/src/util/ApplicationFlagsBitField.js b/packages/discord.js/src/util/ApplicationFlagsBitField.js index f9ad6abacfd7d..2097efbc9a654 100644 --- a/packages/discord.js/src/util/ApplicationFlagsBitField.js +++ b/packages/discord.js/src/util/ApplicationFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { ApplicationFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link ClientApplication#flags} bitfield. @@ -38,4 +38,4 @@ class ApplicationFlagsBitField extends BitField { * @typedef {string|number|ApplicationFlagsBitField|ApplicationFlagsResolvable[]} ApplicationFlagsResolvable */ -module.exports = ApplicationFlagsBitField; +exports.ApplicationFlagsBitField = ApplicationFlagsBitField; diff --git a/packages/discord.js/src/util/AttachmentFlagsBitField.js b/packages/discord.js/src/util/AttachmentFlagsBitField.js index f7f2bd23d0d6e..94bb64b212224 100644 --- a/packages/discord.js/src/util/AttachmentFlagsBitField.js +++ b/packages/discord.js/src/util/AttachmentFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { AttachmentFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with an {@link Attachment#flags} bitfield. @@ -23,4 +23,4 @@ class AttachmentFlagsBitField extends BitField { * @param {BitFieldResolvable} [bits=0] Bit(s) to read from */ -module.exports = AttachmentFlagsBitField; +exports.AttachmentFlagsBitField = AttachmentFlagsBitField; diff --git a/packages/discord.js/src/util/BitField.js b/packages/discord.js/src/util/BitField.js index 917d69132d16f..84de819e0ab8d 100644 --- a/packages/discord.js/src/util/BitField.js +++ b/packages/discord.js/src/util/BitField.js @@ -175,4 +175,4 @@ class BitField { } } -module.exports = BitField; +exports.BitField = BitField; diff --git a/packages/discord.js/src/util/ChannelFlagsBitField.js b/packages/discord.js/src/util/ChannelFlagsBitField.js index ad987e157ec7d..ea2060e2d328c 100644 --- a/packages/discord.js/src/util/ChannelFlagsBitField.js +++ b/packages/discord.js/src/util/ChannelFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { ChannelFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link BaseChannel#flags} bitfield. @@ -38,4 +38,4 @@ class ChannelFlagsBitField extends BitField { * @typedef {string|number|ChannelFlagsBitField|ChannelFlagsResolvable[]} ChannelFlagsResolvable */ -module.exports = ChannelFlagsBitField; +exports.ChannelFlagsBitField = ChannelFlagsBitField; diff --git a/packages/discord.js/src/util/Colors.js b/packages/discord.js/src/util/Colors.js index a2d35e5446547..b2e30ae9540bc 100644 --- a/packages/discord.js/src/util/Colors.js +++ b/packages/discord.js/src/util/Colors.js @@ -39,7 +39,7 @@ * @type {Colors} * @ignore */ -module.exports = { +const Colors = { Default: 0x000000, White: 0xffffff, Aqua: 0x1abc9c, @@ -71,3 +71,5 @@ module.exports = { DarkButNotBlack: 0x2c2f33, NotQuiteBlack: 0x23272a, }; + +exports.Colors = Colors; diff --git a/packages/discord.js/src/util/Components.js b/packages/discord.js/src/util/Components.js index 1a2ccbcd24ad1..bb03a56baea74 100644 --- a/packages/discord.js/src/util/Components.js +++ b/packages/discord.js/src/util/Components.js @@ -133,20 +133,20 @@ function createComponentBuilder(data) { module.exports = { createComponent, createComponentBuilder }; -const ActionRow = require('../structures/ActionRow'); -const ActionRowBuilder = require('../structures/ActionRowBuilder'); -const ButtonBuilder = require('../structures/ButtonBuilder'); -const ButtonComponent = require('../structures/ButtonComponent'); -const ChannelSelectMenuBuilder = require('../structures/ChannelSelectMenuBuilder'); -const ChannelSelectMenuComponent = require('../structures/ChannelSelectMenuComponent'); -const Component = require('../structures/Component'); -const MentionableSelectMenuBuilder = require('../structures/MentionableSelectMenuBuilder'); -const MentionableSelectMenuComponent = require('../structures/MentionableSelectMenuComponent'); -const RoleSelectMenuBuilder = require('../structures/RoleSelectMenuBuilder'); -const RoleSelectMenuComponent = require('../structures/RoleSelectMenuComponent'); -const StringSelectMenuBuilder = require('../structures/StringSelectMenuBuilder'); -const StringSelectMenuComponent = require('../structures/StringSelectMenuComponent'); -const TextInputBuilder = require('../structures/TextInputBuilder'); -const TextInputComponent = require('../structures/TextInputComponent'); -const UserSelectMenuBuilder = require('../structures/UserSelectMenuBuilder'); -const UserSelectMenuComponent = require('../structures/UserSelectMenuComponent'); +const { ActionRow } = require('../structures/ActionRow'); +const { ActionRowBuilder } = require('../structures/ActionRowBuilder'); +const { ButtonBuilder } = require('../structures/ButtonBuilder'); +const { ButtonComponent } = require('../structures/ButtonComponent'); +const { ChannelSelectMenuBuilder } = require('../structures/ChannelSelectMenuBuilder'); +const { ChannelSelectMenuComponent } = require('../structures/ChannelSelectMenuComponent'); +const { Component } = require('../structures/Component'); +const { MentionableSelectMenuBuilder } = require('../structures/MentionableSelectMenuBuilder'); +const { MentionableSelectMenuComponent } = require('../structures/MentionableSelectMenuComponent'); +const { RoleSelectMenuBuilder } = require('../structures/RoleSelectMenuBuilder'); +const { RoleSelectMenuComponent } = require('../structures/RoleSelectMenuComponent'); +const { StringSelectMenuBuilder } = require('../structures/StringSelectMenuBuilder'); +const { StringSelectMenuComponent } = require('../structures/StringSelectMenuComponent'); +const { TextInputBuilder } = require('../structures/TextInputBuilder'); +const { TextInputComponent } = require('../structures/TextInputComponent'); +const { UserSelectMenuBuilder } = require('../structures/UserSelectMenuBuilder'); +const { UserSelectMenuComponent } = require('../structures/UserSelectMenuComponent'); diff --git a/packages/discord.js/src/util/DataResolver.js b/packages/discord.js/src/util/DataResolver.js index 681a0bf91957a..ac75b141b14e2 100644 --- a/packages/discord.js/src/util/DataResolver.js +++ b/packages/discord.js/src/util/DataResolver.js @@ -5,7 +5,7 @@ const fs = require('node:fs/promises'); const path = require('node:path'); const { fetch } = require('undici'); const { DiscordjsError, DiscordjsTypeError, ErrorCodes } = require('../errors'); -const Invite = require('../structures/Invite'); +const { Invite } = require('../structures/Invite'); /** * Data that can be resolved to give an invite code. This can be: @@ -49,7 +49,7 @@ function resolveInviteCode(data) { * @private */ function resolveGuildTemplateCode(data) { - const GuildTemplate = require('../structures/GuildTemplate'); + const { GuildTemplate } = require('../structures/GuildTemplate'); return resolveCode(data, GuildTemplate.GuildTemplatesPattern); } diff --git a/packages/discord.js/src/util/Events.js b/packages/discord.js/src/util/Events.js index 7fb94a6bf909f..f9bd00e8eb98b 100644 --- a/packages/discord.js/src/util/Events.js +++ b/packages/discord.js/src/util/Events.js @@ -87,7 +87,7 @@ * @type {Events} * @ignore */ -module.exports = { +const Events = { ApplicationCommandPermissionsUpdate: 'applicationCommandPermissionsUpdate', AutoModerationActionExecution: 'autoModerationActionExecution', AutoModerationRuleCreate: 'autoModerationRuleCreate', @@ -167,3 +167,5 @@ module.exports = { Warn: 'warn', WebhooksUpdate: 'webhooksUpdate', }; + +exports.Events = Events; diff --git a/packages/discord.js/src/util/GuildMemberFlagsBitField.js b/packages/discord.js/src/util/GuildMemberFlagsBitField.js index 84ce6b903cf90..ea955889f3baa 100644 --- a/packages/discord.js/src/util/GuildMemberFlagsBitField.js +++ b/packages/discord.js/src/util/GuildMemberFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { GuildMemberFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link GuildMember#flags} bitfield. diff --git a/packages/discord.js/src/util/IntentsBitField.js b/packages/discord.js/src/util/IntentsBitField.js index ea908b6017575..0cbe9e78222b9 100644 --- a/packages/discord.js/src/util/IntentsBitField.js +++ b/packages/discord.js/src/util/IntentsBitField.js @@ -1,6 +1,6 @@ 'use strict'; const { GatewayIntentBits } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to calculate intents. @@ -31,4 +31,4 @@ class IntentsBitField extends BitField { * @typedef {string|number|IntentsBitField|IntentsResolvable[]} IntentsResolvable */ -module.exports = IntentsBitField; +exports.IntentsBitField = IntentsBitField; diff --git a/packages/discord.js/src/util/LimitedCollection.js b/packages/discord.js/src/util/LimitedCollection.js index 12a8360a1934e..c9d612dd247fa 100644 --- a/packages/discord.js/src/util/LimitedCollection.js +++ b/packages/discord.js/src/util/LimitedCollection.js @@ -65,4 +65,4 @@ class LimitedCollection extends Collection { } } -module.exports = LimitedCollection; +exports.LimitedCollection = LimitedCollection; diff --git a/packages/discord.js/src/util/MessageFlagsBitField.js b/packages/discord.js/src/util/MessageFlagsBitField.js index e6764b2fd7917..c816ba8fe390a 100644 --- a/packages/discord.js/src/util/MessageFlagsBitField.js +++ b/packages/discord.js/src/util/MessageFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { MessageFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link Message#flags} bitfield. @@ -38,4 +38,4 @@ class MessageFlagsBitField extends BitField { * @name MessageFlagsBitField#bitfield */ -module.exports = MessageFlagsBitField; +exports.MessageFlagsBitField = MessageFlagsBitField; diff --git a/packages/discord.js/src/util/Options.js b/packages/discord.js/src/util/Options.js index aebc63af4d486..bea4757a5167b 100644 --- a/packages/discord.js/src/util/Options.js +++ b/packages/discord.js/src/util/Options.js @@ -113,7 +113,7 @@ class Options extends null { */ static cacheWithLimits(settings = {}) { const { Collection } = require('@discordjs/collection'); - const LimitedCollection = require('./LimitedCollection'); + const { LimitedCollection } = require('./LimitedCollection'); return (managerType, _, manager) => { const setting = settings[manager.name] ?? settings[managerType.name]; @@ -177,7 +177,7 @@ class Options extends null { } } -module.exports = Options; +exports.Options = Options; /** * @external RESTOptions diff --git a/packages/discord.js/src/util/Partials.js b/packages/discord.js/src/util/Partials.js index 31d92231c1d66..2bb29e5fee107 100644 --- a/packages/discord.js/src/util/Partials.js +++ b/packages/discord.js/src/util/Partials.js @@ -33,7 +33,7 @@ const { createEnum } = require('./Enums'); * @type {Partials} * @ignore */ -module.exports = createEnum([ +const Partials = createEnum([ 'User', 'Channel', 'GuildMember', @@ -42,3 +42,5 @@ module.exports = createEnum([ 'GuildScheduledEvent', 'ThreadMember', ]); + +exports.Partials = Partials; diff --git a/packages/discord.js/src/util/PermissionsBitField.js b/packages/discord.js/src/util/PermissionsBitField.js index c1ec72d872e32..a1f55c7861a1c 100644 --- a/packages/discord.js/src/util/PermissionsBitField.js +++ b/packages/discord.js/src/util/PermissionsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { PermissionFlagsBits } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a permission bitfield. All {@link GuildMember}s have a set of @@ -101,4 +101,4 @@ class PermissionsBitField extends BitField { } } -module.exports = PermissionsBitField; +exports.PermissionsBitField = PermissionsBitField; diff --git a/packages/discord.js/src/util/RoleFlagsBitField.js b/packages/discord.js/src/util/RoleFlagsBitField.js index 1e0f89548922d..b3429630d3279 100644 --- a/packages/discord.js/src/util/RoleFlagsBitField.js +++ b/packages/discord.js/src/util/RoleFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { RoleFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link Role#flags} bitfield. @@ -23,4 +23,4 @@ class RoleFlagsBitField extends BitField { * @param {BitFieldResolvable} [bits=0] Bit(s) to read from */ -module.exports = RoleFlagsBitField; +exports.RoleFlagsBitField = RoleFlagsBitField; diff --git a/packages/discord.js/src/util/SKUFlagsBitField.js b/packages/discord.js/src/util/SKUFlagsBitField.js index d70813722bdcb..61298fea37fbf 100644 --- a/packages/discord.js/src/util/SKUFlagsBitField.js +++ b/packages/discord.js/src/util/SKUFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { SKUFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with an {@link SKU#flags} bitfield. diff --git a/packages/discord.js/src/util/ShardEvents.js b/packages/discord.js/src/util/ShardEvents.js index 175a111d2aabb..799d377cef358 100644 --- a/packages/discord.js/src/util/ShardEvents.js +++ b/packages/discord.js/src/util/ShardEvents.js @@ -16,7 +16,7 @@ * @type {ShardEvents} * @ignore */ -module.exports = { +const ShardEvents = { Death: 'death', Disconnect: 'disconnect', Error: 'error', @@ -25,3 +25,5 @@ module.exports = { Resume: 'resume', Spawn: 'spawn', }; + +exports.ShardEvents = ShardEvents; diff --git a/packages/discord.js/src/util/Status.js b/packages/discord.js/src/util/Status.js index c9daddc27c9e8..4baf9ec8d837f 100644 --- a/packages/discord.js/src/util/Status.js +++ b/packages/discord.js/src/util/Status.js @@ -14,4 +14,6 @@ const { createEnum } = require('./Enums'); * @type {Status} * @ignore */ -module.exports = createEnum(['Ready', 'Idle', 'WaitingForGuilds']); +const Status = createEnum(['Ready', 'Idle', 'WaitingForGuilds']); + +exports.Status = Status; diff --git a/packages/discord.js/src/util/Sweepers.js b/packages/discord.js/src/util/Sweepers.js index edc328749f4a1..2258e0d387e82 100644 --- a/packages/discord.js/src/util/Sweepers.js +++ b/packages/discord.js/src/util/Sweepers.js @@ -2,7 +2,7 @@ const { setInterval, clearInterval } = require('node:timers'); const { ThreadChannelTypes, SweeperKeys } = require('./Constants'); -const Events = require('./Events'); +const { Events } = require('./Events'); const { DiscordjsTypeError, ErrorCodes } = require('../errors'); /** @@ -484,4 +484,4 @@ class Sweepers { } } -module.exports = Sweepers; +exports.Sweepers = Sweepers; diff --git a/packages/discord.js/src/util/SystemChannelFlagsBitField.js b/packages/discord.js/src/util/SystemChannelFlagsBitField.js index cbca48f785a38..7474b2d7644b5 100644 --- a/packages/discord.js/src/util/SystemChannelFlagsBitField.js +++ b/packages/discord.js/src/util/SystemChannelFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { GuildSystemChannelFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link Guild#systemChannelFlags} bitfield. @@ -40,4 +40,4 @@ class SystemChannelFlagsBitField extends BitField { * @typedef {string|number|SystemChannelFlagsBitField|SystemChannelFlagsResolvable[]} SystemChannelFlagsResolvable */ -module.exports = SystemChannelFlagsBitField; +exports.SystemChannelFlagsBitField = SystemChannelFlagsBitField; diff --git a/packages/discord.js/src/util/ThreadMemberFlagsBitField.js b/packages/discord.js/src/util/ThreadMemberFlagsBitField.js index c5073a85f8357..2095f854ae3d9 100644 --- a/packages/discord.js/src/util/ThreadMemberFlagsBitField.js +++ b/packages/discord.js/src/util/ThreadMemberFlagsBitField.js @@ -1,6 +1,6 @@ 'use strict'; -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link ThreadMember#flags} bitfield. @@ -28,4 +28,4 @@ class ThreadMemberFlagsBitField extends BitField { * @name ThreadMemberFlagsBitField#bitfield */ -module.exports = ThreadMemberFlagsBitField; +exports.ThreadMemberFlagsBitField = ThreadMemberFlagsBitField; diff --git a/packages/discord.js/src/util/Transformers.js b/packages/discord.js/src/util/Transformers.js index e37fb456c65ae..9dcbb0237a803 100644 --- a/packages/discord.js/src/util/Transformers.js +++ b/packages/discord.js/src/util/Transformers.js @@ -1,7 +1,7 @@ 'use strict'; const { isJSONEncodable } = require('@discordjs/util'); -const snakeCase = require('lodash.snakecase'); +const { snakeCase } = require('lodash.snakecase'); /** * Transforms camel-cased keys into snake cased keys diff --git a/packages/discord.js/src/util/UserFlagsBitField.js b/packages/discord.js/src/util/UserFlagsBitField.js index ea9f8352b0656..a8a2c066b85da 100644 --- a/packages/discord.js/src/util/UserFlagsBitField.js +++ b/packages/discord.js/src/util/UserFlagsBitField.js @@ -1,7 +1,7 @@ 'use strict'; const { UserFlags } = require('discord-api-types/v10'); -const BitField = require('./BitField'); +const { BitField } = require('./BitField'); /** * Data structure that makes it easy to interact with a {@link User#flags} bitfield. @@ -29,4 +29,4 @@ class UserFlagsBitField extends BitField { * @name UserFlagsBitField#bitfield */ -module.exports = UserFlagsBitField; +exports.UserFlagsBitField = UserFlagsBitField; diff --git a/packages/discord.js/src/util/Util.js b/packages/discord.js/src/util/Util.js index 1214ad71fb82d..7e95fa696b096 100644 --- a/packages/discord.js/src/util/Util.js +++ b/packages/discord.js/src/util/Util.js @@ -4,7 +4,7 @@ const { parse } = require('node:path'); const { Collection } = require('@discordjs/collection'); const { ChannelType, RouteBases, Routes } = require('discord-api-types/v10'); const { fetch } = require('undici'); -const Colors = require('./Colors'); +const { Colors } = require('./Colors'); const { DiscordjsError, DiscordjsRangeError, DiscordjsTypeError, ErrorCodes } = require('../errors'); const isObject = d => typeof d === 'object' && d !== null; @@ -521,6 +521,6 @@ module.exports = { }; // Fixes Circular -const Attachment = require('../structures/Attachment'); -const GuildChannel = require('../structures/GuildChannel'); +const { Attachment } = require('../structures/Attachment'); +const { GuildChannel } = require('../structures/GuildChannel'); const { SKU } = require('../structures/SKU.js');