From a355d843ad323c1da4945d824c4a5a365ee61331 Mon Sep 17 00:00:00 2001 From: MARCROCK22 Date: Sun, 15 Sep 2024 19:52:43 +0000 Subject: [PATCH] chore: organize imports --- src/api/Routes/applications.ts | 24 +++---- src/api/Routes/skus.ts | 6 +- src/builders/ActionRow.ts | 4 +- src/builders/Button.ts | 4 +- src/builders/Embed.ts | 2 +- src/builders/Modal.ts | 2 +- src/builders/Poll.ts | 2 +- src/builders/SelectMenu.ts | 20 +++--- src/cache/resources/bans.ts | 6 +- src/cache/resources/channels.ts | 4 +- src/cache/resources/emojis.ts | 6 +- src/cache/resources/guilds.ts | 6 +- src/cache/resources/members.ts | 6 +- src/cache/resources/messages.ts | 6 +- src/cache/resources/overwrites.ts | 2 +- src/cache/resources/roles.ts | 6 +- src/cache/resources/stickers.ts | 6 +- src/cache/resources/threads.ts | 6 +- src/cache/resources/users.ts | 6 +- src/cache/resources/voice-states.ts | 6 +- src/client/collectors.ts | 4 +- src/client/httpclient.ts | 2 +- src/commands/applications/entryPoint.ts | 4 +- src/commands/applications/entrycontext.ts | 16 ++--- src/commands/applications/menu.ts | 2 +- src/commands/applications/menucontext.ts | 26 ++++---- src/commands/basecontext.ts | 2 +- src/commands/optionresolver.ts | 20 +++--- src/common/shorters/interaction.ts | 2 +- src/common/shorters/messages.ts | 8 +-- src/common/shorters/reactions.ts | 4 +- src/common/shorters/roles.ts | 2 +- src/common/shorters/templates.ts | 2 +- src/common/shorters/threads.ts | 6 +- src/common/types/resolvables.ts | 2 +- src/common/types/write.ts | 20 +++--- src/components/BaseComponent.ts | 2 +- src/components/ButtonComponent.ts | 2 +- src/components/componentcommand.ts | 4 +- src/components/componentcontext.ts | 14 ++--- src/components/modalcontext.ts | 14 ++--- src/events/handler.ts | 30 ++++----- src/events/hooks/application_command.ts | 4 +- src/events/hooks/auto_moderation.ts | 6 +- src/events/hooks/channel.ts | 4 +- src/events/hooks/dispatch.ts | 4 +- src/events/hooks/entitlement.ts | 2 +- src/events/hooks/guild.ts | 16 ++--- src/events/hooks/integration.ts | 6 +- src/events/hooks/interactions.ts | 4 +- src/events/hooks/invite.ts | 2 +- src/events/hooks/message.ts | 6 +- src/events/hooks/presence.ts | 2 +- src/events/hooks/stage.ts | 6 +- src/events/hooks/thread.ts | 6 +- src/events/hooks/typing.ts | 6 +- src/events/hooks/user.ts | 4 +- src/events/hooks/voice.ts | 6 +- src/events/hooks/webhook.ts | 4 +- src/langs/handler.ts | 6 +- src/structures/Guild.ts | 4 +- src/structures/GuildBan.ts | 2 +- src/structures/GuildEmoji.ts | 2 +- src/structures/GuildMember.ts | 34 +++++----- src/structures/GuildRole.ts | 4 +- src/structures/GuildTemplate.ts | 2 +- src/structures/Message.ts | 30 ++++----- src/structures/Poll.ts | 8 +-- src/structures/Sticker.ts | 6 +- src/structures/Webhook.ts | 20 +++--- src/structures/extra/BaseGuild.ts | 2 +- src/structures/extra/DiscordBase.ts | 2 +- src/types/gateway.ts | 20 +++--- src/types/payloads/_interactions/base.ts | 2 +- src/types/payloads/channel.ts | 2 +- src/types/payloads/guild.ts | 2 +- src/types/rest/application.ts | 6 +- src/types/rest/auditLog.ts | 2 +- src/types/rest/channel.ts | 42 ++++++------- src/types/rest/guild.ts | 46 +++++++------- src/types/rest/guildScheduledEvent.ts | 6 +- src/types/rest/oauth2.ts | 2 +- src/types/rest/poll.ts | 2 +- src/types/rest/stageInstance.ts | 2 +- src/types/rest/template.ts | 2 +- src/types/rest/user.ts | 8 +-- src/types/rest/webhook.ts | 10 +-- src/websocket/SharedTypes.ts | 76 +++++++++++------------ src/websocket/structures/index.ts | 2 +- 89 files changed, 380 insertions(+), 380 deletions(-) diff --git a/src/api/Routes/applications.ts b/src/api/Routes/applications.ts index ee15c01..f49f9e9 100644 --- a/src/api/Routes/applications.ts +++ b/src/api/Routes/applications.ts @@ -1,20 +1,32 @@ import type { + RESTDeleteAPIApplicationEmojiResult, RESTGetAPIApplicationCommandResult, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, + RESTGetAPIApplicationEmojiResult, + RESTGetAPIApplicationEmojisResult, RESTGetAPIApplicationGuildCommandResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTGetAPIApplicationRoleConnectionMetadataResult, + RESTGetAPIEntitlementsQuery, + RESTGetAPIEntitlementsResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, + RESTGetAPISKUsResult, RESTPatchAPIApplicationCommandJSONBody, RESTPatchAPIApplicationCommandResult, + RESTPatchAPIApplicationEmojiJSONBody, + RESTPatchAPIApplicationEmojiResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationCommandsResult, + RESTPostAPIApplicationEmojiJSONBody, + RESTPostAPIApplicationEmojiResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, + RESTPostAPIEntitlementBody, + RESTPostAPIEntitlementResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, @@ -23,18 +35,6 @@ import type { RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPutAPIGuildApplicationCommandsPermissionsResult, - RESTGetAPIApplicationEmojiResult, - RESTGetAPIApplicationEmojisResult, - RESTPostAPIApplicationEmojiJSONBody, - RESTPatchAPIApplicationEmojiJSONBody, - RESTPostAPIApplicationEmojiResult, - RESTPatchAPIApplicationEmojiResult, - RESTDeleteAPIApplicationEmojiResult, - RESTGetAPIEntitlementsResult, - RESTGetAPIEntitlementsQuery, - RESTPostAPIEntitlementBody, - RESTPostAPIEntitlementResult, - RESTGetAPISKUsResult, } from '../../types'; import type { ProxyRequestMethod } from '../Router'; diff --git a/src/api/Routes/skus.ts b/src/api/Routes/skus.ts index 088b5b1..a1141c6 100644 --- a/src/api/Routes/skus.ts +++ b/src/api/Routes/skus.ts @@ -1,10 +1,10 @@ import type { - RESTGetAPISKUSubscriptionsResult, - RESTGetAPISKUSubscriptionsQuery, RESTGetAPISKUSubscriptionResult, + RESTGetAPISKUSubscriptionsQuery, + RESTGetAPISKUSubscriptionsResult, } from '../../types'; -import type { RestArguments } from '../api'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface SKuRoutes { skus(id: string): { diff --git a/src/builders/ActionRow.ts b/src/builders/ActionRow.ts index 315b6af..90d3196 100644 --- a/src/builders/ActionRow.ts +++ b/src/builders/ActionRow.ts @@ -1,10 +1,10 @@ +import type { RestOrArray } from '../common/types/util'; import { - ComponentType, type APIActionRowComponent, type APIActionRowComponentTypes, type APIMessageActionRowComponent, + ComponentType, } from '../types'; -import type { RestOrArray } from '../common/types/util'; import { BaseComponentBuilder } from './Base'; import { fromComponent } from './index'; import type { BuilderComponents, FixedComponents } from './types'; diff --git a/src/builders/Button.ts b/src/builders/Button.ts index 8220730..5e6b592 100644 --- a/src/builders/Button.ts +++ b/src/builders/Button.ts @@ -1,5 +1,5 @@ -import { type APIMessageComponentEmoji, type ButtonStyle, ComponentType, type APIButtonComponent } from '../types'; -import { resolvePartialEmoji, type EmojiResolvable } from '../common'; +import { type EmojiResolvable, resolvePartialEmoji } from '../common'; +import { type APIButtonComponent, type APIMessageComponentEmoji, type ButtonStyle, ComponentType } from '../types'; /** * Represents a button component. diff --git a/src/builders/Embed.ts b/src/builders/Embed.ts index c8166c6..ddcd0bd 100644 --- a/src/builders/Embed.ts +++ b/src/builders/Embed.ts @@ -1,5 +1,5 @@ +import { type ColorResolvable, type ObjectToLower, type RestOrArray, resolveColor, toSnakeCase } from '../common'; import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter } from '../types'; -import { resolveColor, toSnakeCase, type ColorResolvable, type ObjectToLower, type RestOrArray } from '../common'; /** * Represents a message embed. diff --git a/src/builders/Modal.ts b/src/builders/Modal.ts index a329eaf..7a3a71f 100644 --- a/src/builders/Modal.ts +++ b/src/builders/Modal.ts @@ -1,3 +1,4 @@ +import type { RestOrArray } from '../common'; import { type APIActionRowComponent, type APIModalInteractionResponseCallbackData, @@ -5,7 +6,6 @@ import { ComponentType, type TextInputStyle, } from '../types'; -import type { RestOrArray } from '../common'; import type { ActionRow } from './ActionRow'; import { BaseComponentBuilder, type OptionValuesLength } from './Base'; import { fromComponent } from './index'; diff --git a/src/builders/Poll.ts b/src/builders/Poll.ts index a16c379..86e6d80 100644 --- a/src/builders/Poll.ts +++ b/src/builders/Poll.ts @@ -1,5 +1,5 @@ +import { type DeepPartial, type EmojiResolvable, type RestOrArray, resolvePartialEmoji } from '../common'; import { type APIPollMedia, PollLayoutType, type RESTAPIPollCreate } from '../types'; -import { resolvePartialEmoji, type DeepPartial, type EmojiResolvable, type RestOrArray } from '../common'; export class PollBuilder { constructor(public data: DeepPartial = {}) { diff --git a/src/builders/SelectMenu.ts b/src/builders/SelectMenu.ts index 1b0961e..dff1792 100644 --- a/src/builders/SelectMenu.ts +++ b/src/builders/SelectMenu.ts @@ -1,3 +1,13 @@ +import type { EmojiResolvable, RestOrArray, ToClass } from '../common'; +import { resolvePartialEmoji } from '../common/it/utils'; +import type { + ChannelSelectMenuInteraction, + ComponentInteraction, + MentionableSelectMenuInteraction, + RoleSelectMenuInteraction, + StringSelectMenuInteraction, + UserSelectMenuInteraction, +} from '../structures'; import { type APIChannelSelectComponent, type APIMentionableSelectComponent, @@ -12,16 +22,6 @@ import { ComponentType, SelectMenuDefaultValueType, } from '../types'; -import type { EmojiResolvable, RestOrArray, ToClass } from '../common'; -import type { - ChannelSelectMenuInteraction, - ComponentInteraction, - MentionableSelectMenuInteraction, - RoleSelectMenuInteraction, - StringSelectMenuInteraction, - UserSelectMenuInteraction, -} from '../structures'; -import { resolvePartialEmoji } from '../common/it/utils'; import { BaseComponentBuilder, type OptionValuesLength } from './Base'; export type BuilderSelectMenus = diff --git a/src/cache/resources/bans.ts b/src/cache/resources/bans.ts index f4453c5..b71d7ee 100644 --- a/src/cache/resources/bans.ts +++ b/src/cache/resources/bans.ts @@ -1,8 +1,8 @@ -import type { APIBan, GatewayGuildBanModifyDispatchData } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildBasedResource } from './default/guild-based'; import { type GuildBanStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIBan, GatewayGuildBanModifyDispatchData } from '../../types'; +import { GuildBasedResource } from './default/guild-based'; export class Bans extends GuildBasedResource { namespace = 'ban'; diff --git a/src/cache/resources/channels.ts b/src/cache/resources/channels.ts index d0bccbe..e38396d 100644 --- a/src/cache/resources/channels.ts +++ b/src/cache/resources/channels.ts @@ -1,6 +1,6 @@ -import type { APIChannel } from '../../types'; import { fakePromise } from '../../common'; -import { channelFrom, type AllChannels } from '../../structures'; +import { type AllChannels, channelFrom } from '../../structures'; +import type { APIChannel } from '../../types'; import type { ReturnCache } from '../index'; import { GuildRelatedResource } from './default/guild-related'; diff --git a/src/cache/resources/emojis.ts b/src/cache/resources/emojis.ts index 913250d..00d1e7f 100644 --- a/src/cache/resources/emojis.ts +++ b/src/cache/resources/emojis.ts @@ -1,8 +1,8 @@ -import type { APIEmoji } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildRelatedResource } from './default/guild-related'; import { type GuildEmojiStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIEmoji } from '../../types'; +import { GuildRelatedResource } from './default/guild-related'; export class Emojis extends GuildRelatedResource { namespace = 'emoji'; diff --git a/src/cache/resources/guilds.ts b/src/cache/resources/guilds.ts index 855b93d..9af9192 100644 --- a/src/cache/resources/guilds.ts +++ b/src/cache/resources/guilds.ts @@ -1,8 +1,8 @@ -import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types'; import type { Cache, ReturnCache } from '..'; -import { fakePromise } from '../../common'; -import { BaseResource } from './default/base'; import { type GuildStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types'; +import { BaseResource } from './default/base'; export class Guilds extends BaseResource { namespace = 'guild'; diff --git a/src/cache/resources/members.ts b/src/cache/resources/members.ts index ba43765..91af8ae 100644 --- a/src/cache/resources/members.ts +++ b/src/cache/resources/members.ts @@ -1,8 +1,8 @@ -import type { APIGuildMember } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildBasedResource } from './default/guild-based'; import { type GuildMemberStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIGuildMember } from '../../types'; +import { GuildBasedResource } from './default/guild-based'; export class Members extends GuildBasedResource { namespace = 'member'; diff --git a/src/cache/resources/messages.ts b/src/cache/resources/messages.ts index b39db42..401dd97 100644 --- a/src/cache/resources/messages.ts +++ b/src/cache/resources/messages.ts @@ -1,8 +1,8 @@ +import type { MessageData, ReturnCache } from '../..'; +import { type MessageStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; import type { APIMessage, APIUser } from '../../types'; import { GuildRelatedResource } from './default/guild-related'; -import type { MessageData, ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { type MessageStructure, Transformers } from '../../client/transformers'; export class Messages extends GuildRelatedResource { namespace = 'message'; diff --git a/src/cache/resources/overwrites.ts b/src/cache/resources/overwrites.ts index 39f64e8..10d15f9 100644 --- a/src/cache/resources/overwrites.ts +++ b/src/cache/resources/overwrites.ts @@ -1,7 +1,7 @@ -import type { APIOverwrite } from '../../types'; import type { ReturnCache } from '../..'; import { fakePromise } from '../../common/it/utils'; import { PermissionsBitField } from '../../structures/extra/Permissions'; +import type { APIOverwrite } from '../../types'; import { GuildRelatedResource } from './default/guild-related'; export class Overwrites extends GuildRelatedResource { diff --git a/src/cache/resources/roles.ts b/src/cache/resources/roles.ts index 8dd71ae..011ffed 100644 --- a/src/cache/resources/roles.ts +++ b/src/cache/resources/roles.ts @@ -1,8 +1,8 @@ -import type { APIRole } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildRelatedResource } from './default/guild-related'; import { type GuildRoleStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIRole } from '../../types'; +import { GuildRelatedResource } from './default/guild-related'; export class Roles extends GuildRelatedResource { namespace = 'role'; diff --git a/src/cache/resources/stickers.ts b/src/cache/resources/stickers.ts index 3b5036c..c7b7707 100644 --- a/src/cache/resources/stickers.ts +++ b/src/cache/resources/stickers.ts @@ -1,8 +1,8 @@ -import type { APISticker } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildRelatedResource } from './default/guild-related'; import { type StickerStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APISticker } from '../../types'; +import { GuildRelatedResource } from './default/guild-related'; export class Stickers extends GuildRelatedResource { namespace = 'sticker'; diff --git a/src/cache/resources/threads.ts b/src/cache/resources/threads.ts index 9c9ba8c..bd8f3dc 100644 --- a/src/cache/resources/threads.ts +++ b/src/cache/resources/threads.ts @@ -1,8 +1,8 @@ -import type { APIThreadChannel } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildRelatedResource } from './default/guild-related'; import { type ThreadChannelStructure, Transformers } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIThreadChannel } from '../../types'; +import { GuildRelatedResource } from './default/guild-related'; export class Threads extends GuildRelatedResource { namespace = 'thread'; diff --git a/src/cache/resources/users.ts b/src/cache/resources/users.ts index e704d04..1d11f4a 100644 --- a/src/cache/resources/users.ts +++ b/src/cache/resources/users.ts @@ -1,8 +1,8 @@ -import type { APIUser } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { BaseResource } from './default/base'; import { Transformers, type UserStructure } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIUser } from '../../types'; +import { BaseResource } from './default/base'; export class Users extends BaseResource { namespace = 'user'; diff --git a/src/cache/resources/voice-states.ts b/src/cache/resources/voice-states.ts index 3bd6b69..82d8f63 100644 --- a/src/cache/resources/voice-states.ts +++ b/src/cache/resources/voice-states.ts @@ -1,8 +1,8 @@ -import type { APIVoiceState } from '../../types'; import type { ReturnCache } from '../..'; -import { fakePromise } from '../../common'; -import { GuildBasedResource } from './default/guild-based'; import { Transformers, type VoiceStateStructure } from '../../client/transformers'; +import { fakePromise } from '../../common'; +import type { APIVoiceState } from '../../types'; +import { GuildBasedResource } from './default/guild-based'; export class VoiceStates extends GuildBasedResource { namespace = 'voice_state'; diff --git a/src/client/collectors.ts b/src/client/collectors.ts index 5313aa7..a6b4975 100644 --- a/src/client/collectors.ts +++ b/src/client/collectors.ts @@ -1,9 +1,9 @@ +import { error } from 'node:console'; import { randomUUID } from 'node:crypto'; +import type { UsingClient } from '../commands'; import type { Awaitable, CamelCase } from '../common'; import type { CallbackEventHandler, CustomEventsKeys, GatewayEvents } from '../events'; -import { error } from 'node:console'; import * as RawEvents from '../events/hooks'; -import type { UsingClient } from '../commands'; export type AllClientEvents = CustomEventsKeys | GatewayEvents; export type ParseClientEventName = T extends CustomEventsKeys ? T : CamelCase; diff --git a/src/client/httpclient.ts b/src/client/httpclient.ts index 5f50c84..5989c6b 100644 --- a/src/client/httpclient.ts +++ b/src/client/httpclient.ts @@ -1,6 +1,6 @@ -import type { APIInteractionResponse, APIInteraction } from '../types'; import { isBufferLike } from '../api/utils/utils'; import type { DeepPartial } from '../common'; +import type { APIInteraction, APIInteractionResponse } from '../types'; import type { BaseClientOptions, StartOptions } from './base'; import { BaseClient } from './base'; diff --git a/src/commands/applications/entryPoint.ts b/src/commands/applications/entryPoint.ts index b6c5f88..70b825c 100644 --- a/src/commands/applications/entryPoint.ts +++ b/src/commands/applications/entryPoint.ts @@ -1,8 +1,8 @@ -import { magicImport, type PermissionStrings } from '../../common'; +import { type PermissionStrings, magicImport } from '../../common'; import { ApplicationCommandType, - type EntryPointCommandHandlerType, type ApplicationIntegrationType, + type EntryPointCommandHandlerType, type InteractionContextType, type LocaleString, } from '../../types'; diff --git a/src/commands/applications/entrycontext.ts b/src/commands/applications/entrycontext.ts index 6469671..3b3f2c9 100644 --- a/src/commands/applications/entrycontext.ts +++ b/src/commands/applications/entrycontext.ts @@ -1,5 +1,10 @@ -import { MessageFlags } from '../../types'; import type { ReturnCache } from '../..'; +import type { + GuildMemberStructure, + GuildStructure, + MessageStructure, + WebhookMessageStructure, +} from '../../client/transformers'; import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, @@ -8,16 +13,11 @@ import type { When, } from '../../common'; import type { AllChannels, EntryPointInteraction } from '../../structures'; +import { MessageFlags } from '../../types'; import { BaseContext } from '../basecontext'; import type { RegisteredMiddlewares } from '../decorators'; -import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared'; -import type { - GuildMemberStructure, - GuildStructure, - MessageStructure, - WebhookMessageStructure, -} from '../../client/transformers'; import type { EntryPointCommand } from './entryPoint'; +import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared'; export interface EntryPointContext extends BaseContext, ExtendContext {} diff --git a/src/commands/applications/menu.ts b/src/commands/applications/menu.ts index e50607c..2cce941 100644 --- a/src/commands/applications/menu.ts +++ b/src/commands/applications/menu.ts @@ -1,10 +1,10 @@ +import { type PermissionStrings, magicImport } from '../../common'; import type { ApplicationCommandType, ApplicationIntegrationType, InteractionContextType, LocaleString, } from '../../types'; -import { magicImport, type PermissionStrings } from '../../common'; import type { RegisteredMiddlewares } from '../decorators'; import type { MenuCommandContext } from './menucontext'; import type { ExtraProps, UsingClient } from './shared'; diff --git a/src/commands/applications/menucontext.ts b/src/commands/applications/menucontext.ts index 332422f..cf1e5d1 100644 --- a/src/commands/applications/menucontext.ts +++ b/src/commands/applications/menucontext.ts @@ -1,17 +1,4 @@ -import { type APIMessage, ApplicationCommandType, MessageFlags } from '../../types'; import type { ContextMenuCommand, ReturnCache } from '../..'; -import { - toSnakeCase, - type InteractionCreateBodyRequest, - type InteractionMessageUpdateBodyRequest, - type ModalCreateBodyRequest, - type UnionToTuple, - type When, -} from '../../common'; -import type { AllChannels, MessageCommandInteraction, UserCommandInteraction } from '../../structures'; -import { BaseContext } from '../basecontext'; -import type { RegisteredMiddlewares } from '../decorators'; -import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared'; import { type GuildMemberStructure, type GuildStructure, @@ -20,6 +7,19 @@ import { type UserStructure, type WebhookMessageStructure, } from '../../client/transformers'; +import { + type InteractionCreateBodyRequest, + type InteractionMessageUpdateBodyRequest, + type ModalCreateBodyRequest, + type UnionToTuple, + type When, + toSnakeCase, +} from '../../common'; +import type { AllChannels, MessageCommandInteraction, UserCommandInteraction } from '../../structures'; +import { type APIMessage, ApplicationCommandType, MessageFlags } from '../../types'; +import { BaseContext } from '../basecontext'; +import type { RegisteredMiddlewares } from '../decorators'; +import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared'; export type InteractionTarget = T extends MessageCommandInteraction ? MessageStructure : UserStructure; diff --git a/src/commands/basecontext.ts b/src/commands/basecontext.ts index 66eb613..b9a2974 100644 --- a/src/commands/basecontext.ts +++ b/src/commands/basecontext.ts @@ -1,5 +1,5 @@ import type { ModalContext } from '../components'; -import type { ContextComponentCommandInteractionMap, ComponentContext } from '../components/componentcontext'; +import type { ComponentContext, ContextComponentCommandInteractionMap } from '../components/componentcontext'; import type { MessageCommandInteraction, UserCommandInteraction } from '../structures'; import type { CommandContext } from './applications/chatcontext'; import type { MenuCommandContext } from './applications/menucontext'; diff --git a/src/commands/optionresolver.ts b/src/commands/optionresolver.ts index 619c525..f61a3fe 100644 --- a/src/commands/optionresolver.ts +++ b/src/commands/optionresolver.ts @@ -1,3 +1,13 @@ +import { Attachment } from '../builders'; +import { + type GuildMemberStructure, + type GuildRoleStructure, + type InteractionGuildMemberStructure, + Transformers, + type UserStructure, +} from '../client/transformers'; +import type { MakeRequired } from '../common'; +import { type AllChannels, channelFrom } from '../structures'; import { type APIApplicationCommandInteractionDataOption, type APIAttachment, @@ -8,18 +18,8 @@ import { type APIUser, ApplicationCommandOptionType, } from '../types'; -import type { MakeRequired } from '../common'; -import { channelFrom, type AllChannels } from '../structures'; import type { Command, CommandAutocompleteOption, CommandOption, SubCommand } from './applications/chat'; import type { UsingClient } from './applications/shared'; -import { - type GuildMemberStructure, - type GuildRoleStructure, - type InteractionGuildMemberStructure, - Transformers, - type UserStructure, -} from '../client/transformers'; -import { Attachment } from '../builders'; export type ContextOptionsResolved = { members?: Record | APIInteractionGuildMember>; diff --git a/src/common/shorters/interaction.ts b/src/common/shorters/interaction.ts index 57ea8e8..be225a8 100644 --- a/src/common/shorters/interaction.ts +++ b/src/common/shorters/interaction.ts @@ -1,4 +1,4 @@ -import { BaseInteraction, resolveFiles, type ReplyInteractionBody, Modal } from '../..'; +import { BaseInteraction, Modal, type ReplyInteractionBody, resolveFiles } from '../..'; import { Transformers } from '../../client/transformers'; import type { InteractionMessageUpdateBodyRequest, MessageWebhookCreateBodyRequest } from '../types/write'; import { BaseShorter } from './base'; diff --git a/src/common/shorters/messages.ts b/src/common/shorters/messages.ts index cc7d199..c71bce6 100644 --- a/src/common/shorters/messages.ts +++ b/src/common/shorters/messages.ts @@ -1,15 +1,15 @@ +import { resolveFiles } from '../../builders'; +import { MessagesMethods } from '../../structures'; import type { RESTPatchAPIChannelMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessagesThreadsJSONBody, } from '../../types'; -import { resolveFiles } from '../../builders'; -import { MessagesMethods } from '../../structures'; -import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../types/write'; -import { BaseShorter } from './base'; import type { ValidAnswerId } from '../../api/Routes/channels'; import { Transformers } from '../../client/transformers'; +import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../types/write'; +import { BaseShorter } from './base'; export class MessageShorter extends BaseShorter { async write(channelId: string, { files, ...body }: MessageCreateBodyRequest) { diff --git a/src/common/shorters/reactions.ts b/src/common/shorters/reactions.ts index c4c46d9..171c4f0 100644 --- a/src/common/shorters/reactions.ts +++ b/src/common/shorters/reactions.ts @@ -1,8 +1,8 @@ -import type { RESTGetAPIChannelMessageReactionUsersQuery } from '../../types'; +import { Transformers, type UserStructure } from '../../client/transformers'; import { encodeEmoji, resolveEmoji } from '../../common/it/utils'; +import type { RESTGetAPIChannelMessageReactionUsersQuery } from '../../types'; import type { EmojiResolvable } from '../types/resolvables'; import { BaseShorter } from './base'; -import { Transformers, type UserStructure } from '../../client/transformers'; export class ReactionShorter extends BaseShorter { async add(messageId: string, channelId: string, emoji: EmojiResolvable): Promise { diff --git a/src/common/shorters/roles.ts b/src/common/shorters/roles.ts index 291e545..700d5c6 100644 --- a/src/common/shorters/roles.ts +++ b/src/common/shorters/roles.ts @@ -1,3 +1,4 @@ +import { Transformers } from '../../client/transformers'; import type { APIRole, RESTPatchAPIGuildRoleJSONBody, @@ -5,7 +6,6 @@ import type { RESTPostAPIGuildRoleJSONBody, } from '../../types'; import { BaseShorter } from './base'; -import { Transformers } from '../../client/transformers'; export class RoleShorter extends BaseShorter { /** diff --git a/src/common/shorters/templates.ts b/src/common/shorters/templates.ts index ddb1c43..a4d0abf 100644 --- a/src/common/shorters/templates.ts +++ b/src/common/shorters/templates.ts @@ -1,6 +1,6 @@ +import { Transformers } from '../../client/transformers'; import type { RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from '../../types'; import { BaseShorter } from './base'; -import { Transformers } from '../../client/transformers'; export class TemplateShorter extends BaseShorter { fetch(code: string) { diff --git a/src/common/shorters/threads.ts b/src/common/shorters/threads.ts index 2ae8d07..43a8d98 100644 --- a/src/common/shorters/threads.ts +++ b/src/common/shorters/threads.ts @@ -1,3 +1,5 @@ +import type { ThreadChannelStructure } from '../../client/transformers'; +import { channelFrom } from '../../structures'; import type { APIThreadMember, RESTGetAPIChannelThreadMembersQuery, @@ -7,10 +9,8 @@ import type { RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody, } from '../../types'; -import { BaseShorter } from './base'; import type { MakeRequired, When } from '../types/util'; -import type { ThreadChannelStructure } from '../../client/transformers'; -import { channelFrom } from '../../structures'; +import { BaseShorter } from './base'; export class ThreadShorter extends BaseShorter { /** diff --git a/src/common/types/resolvables.ts b/src/common/types/resolvables.ts index 80a2678..ffdc7e6 100644 --- a/src/common/types/resolvables.ts +++ b/src/common/types/resolvables.ts @@ -1,7 +1,7 @@ -import type { APIGuildMember, APIPartialEmoji } from '../../types'; import type { EmbedColors } from '..'; import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders'; import type { GuildMember } from '../../structures'; +import type { APIGuildMember, APIPartialEmoji } from '../../types'; export type EmojiResolvable = string | Partial | `<${string | undefined}:${string}:${string}>`; export type GuildMemberResolvable = string | Partial | APIGuildMember; diff --git a/src/common/types/write.ts b/src/common/types/write.ts index d31c41b..871427d 100644 --- a/src/common/types/write.ts +++ b/src/common/types/write.ts @@ -1,3 +1,13 @@ +import type { RawFile } from '../../api'; +import type { + ActionRow, + Attachment, + AttachmentBuilder, + BuilderComponents, + Embed, + Modal, + PollBuilder, +} from '../../builders'; import type { APIActionRowComponent, APIEmbed, @@ -11,16 +21,6 @@ import type { RESTPostAPIChannelMessageJSONBody, RESTPostAPIWebhookWithTokenJSONBody, } from '../../types'; -import type { RawFile } from '../../api'; -import type { - ActionRow, - Attachment, - AttachmentBuilder, - BuilderComponents, - Embed, - Modal, - PollBuilder, -} from '../../builders'; import type { OmitInsert } from './util'; diff --git a/src/components/BaseComponent.ts b/src/components/BaseComponent.ts index 332c661..1f6e634 100644 --- a/src/components/BaseComponent.ts +++ b/src/components/BaseComponent.ts @@ -1,3 +1,4 @@ +import { fromComponent } from '../builders'; import { type APIActionRowComponent, type APIActionRowComponentTypes, @@ -10,7 +11,6 @@ import { type APIUserSelectComponent, ComponentType, } from '../types'; -import { fromComponent } from '../builders'; export class BaseComponent { constructor(public data: APIComponentsMap[T]) {} diff --git a/src/components/ButtonComponent.ts b/src/components/ButtonComponent.ts index 19b78fc..ad1c2a9 100644 --- a/src/components/ButtonComponent.ts +++ b/src/components/ButtonComponent.ts @@ -1,3 +1,4 @@ +import { Button } from '../builders'; import type { APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, @@ -5,7 +6,6 @@ import type { ButtonStyle, ComponentType, } from '../types'; -import { Button } from '../builders'; import { BaseComponent } from './BaseComponent'; export class LinkButtonComponent extends BaseComponent { diff --git a/src/components/componentcommand.ts b/src/components/componentcommand.ts index aae4430..e124657 100644 --- a/src/components/componentcommand.ts +++ b/src/components/componentcommand.ts @@ -1,6 +1,6 @@ -import { ComponentType } from '../types'; -import type { ContextComponentCommandInteractionMap, ComponentContext } from './componentcontext'; import type { ExtraProps, RegisteredMiddlewares, UsingClient } from '../commands'; +import { ComponentType } from '../types'; +import type { ComponentContext, ContextComponentCommandInteractionMap } from './componentcontext'; export const InteractionCommandType = { COMPONENT: 0, diff --git a/src/components/componentcontext.ts b/src/components/componentcontext.ts index cc43692..3a2f477 100644 --- a/src/components/componentcontext.ts +++ b/src/components/componentcontext.ts @@ -1,4 +1,3 @@ -import { ComponentType, MessageFlags } from '../types'; import type { AllChannels, ButtonInteraction, @@ -10,6 +9,12 @@ import type { StringSelectMenuInteraction, UserSelectMenuInteraction, } from '..'; +import type { + GuildMemberStructure, + GuildStructure, + MessageStructure, + WebhookMessageStructure, +} from '../client/transformers'; import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands'; import { BaseContext } from '../commands/basecontext'; import type { @@ -20,12 +25,7 @@ import type { UnionToTuple, When, } from '../common'; -import type { - GuildMemberStructure, - GuildStructure, - MessageStructure, - WebhookMessageStructure, -} from '../client/transformers'; +import { ComponentType, MessageFlags } from '../types'; export interface ComponentContext< Type extends keyof ContextComponentCommandInteractionMap = keyof ContextComponentCommandInteractionMap, diff --git a/src/components/modalcontext.ts b/src/components/modalcontext.ts index 8170723..3af39f7 100644 --- a/src/components/modalcontext.ts +++ b/src/components/modalcontext.ts @@ -1,5 +1,10 @@ -import { MessageFlags } from '../types'; import type { AllChannels, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..'; +import type { + GuildMemberStructure, + GuildStructure, + MessageStructure, + WebhookMessageStructure, +} from '../client/transformers'; import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands'; import { BaseContext } from '../commands/basecontext'; import type { @@ -9,12 +14,7 @@ import type { UnionToTuple, When, } from '../common'; -import type { - GuildMemberStructure, - GuildStructure, - MessageStructure, - WebhookMessageStructure, -} from '../client/transformers'; +import { MessageFlags } from '../types'; export interface ModalContext extends BaseContext, ExtendContext {} diff --git a/src/events/handler.ts b/src/events/handler.ts index d496874..9a79a45 100644 --- a/src/events/handler.ts +++ b/src/events/handler.ts @@ -1,24 +1,24 @@ +import type { Client, WorkerClient } from '../client'; +import type { UsingClient } from '../commands'; +import type { FileLoaded } from '../commands/handler'; +import { + BaseHandler, + type CamelCase, + type MakeRequired, + ReplaceRegex, + type SnakeCase, + isCloudfareWorker, + magicImport, +} from '../common'; +import type { ClientEvents } from '../events/hooks'; +import * as RawEvents from '../events/hooks'; import type { GatewayDispatchPayload, GatewayMessageCreateDispatch, GatewayMessageDeleteBulkDispatch, GatewayMessageDeleteDispatch, } from '../types'; -import type { Client, WorkerClient } from '../client'; -import { - BaseHandler, - type CamelCase, - ReplaceRegex, - isCloudfareWorker, - magicImport, - type MakeRequired, - type SnakeCase, -} from '../common'; -import type { ClientEvents } from '../events/hooks'; -import * as RawEvents from '../events/hooks'; -import type { ClientEvent, CustomEvents, CustomEventsKeys, ClientNameEvents, EventContext } from './event'; -import type { FileLoaded } from '../commands/handler'; -import type { UsingClient } from '../commands'; +import type { ClientEvent, ClientNameEvents, CustomEvents, CustomEventsKeys, EventContext } from './event'; export type EventValue = MakeRequired & { fired?: boolean }; export type GatewayEvents = Uppercase>; diff --git a/src/events/hooks/application_command.ts b/src/events/hooks/application_command.ts index a38064f..3171da9 100644 --- a/src/events/hooks/application_command.ts +++ b/src/events/hooks/application_command.ts @@ -1,6 +1,6 @@ -import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../types'; -import { toCamelCase } from '../../common'; import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; +import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../types'; export const APPLICATION_COMMAND_PERMISSIONS_UPDATE = ( _self: UsingClient, diff --git a/src/events/hooks/auto_moderation.ts b/src/events/hooks/auto_moderation.ts index b6a9a84..e65ae49 100644 --- a/src/events/hooks/auto_moderation.ts +++ b/src/events/hooks/auto_moderation.ts @@ -1,12 +1,12 @@ +import { Transformers } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; import type { GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData, } from '../../types'; -import { toCamelCase } from '../../common'; -import type { UsingClient } from '../../commands'; -import { Transformers } from '../../client/transformers'; export const AUTO_MODERATION_ACTION_EXECUTION = ( _self: UsingClient, diff --git a/src/events/hooks/channel.ts b/src/events/hooks/channel.ts index 2730142..11b05e1 100644 --- a/src/events/hooks/channel.ts +++ b/src/events/hooks/channel.ts @@ -5,9 +5,9 @@ import type { GatewayChannelUpdateDispatchData, } from '../../types'; -import { toCamelCase } from '../../common'; -import { channelFrom, type AllChannels } from '../../structures'; import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; +import { type AllChannels, channelFrom } from '../../structures'; export const CHANNEL_CREATE = (self: UsingClient, data: GatewayChannelCreateDispatchData) => { return channelFrom(data, self); diff --git a/src/events/hooks/dispatch.ts b/src/events/hooks/dispatch.ts index 6832fd8..4717251 100644 --- a/src/events/hooks/dispatch.ts +++ b/src/events/hooks/dispatch.ts @@ -1,6 +1,6 @@ -import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from '../../types'; -import type { UsingClient } from '../../commands'; import { Transformers } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from '../../types'; export const READY = (self: UsingClient, data: GatewayReadyDispatchData) => { return Transformers.ClientUser(self, data.user, data.application); diff --git a/src/events/hooks/entitlement.ts b/src/events/hooks/entitlement.ts index c4dc88d..e2f41b8 100644 --- a/src/events/hooks/entitlement.ts +++ b/src/events/hooks/entitlement.ts @@ -1,6 +1,6 @@ -import type { APIEntitlement } from '../../types'; import type { UsingClient } from '../../commands'; import { Entitlement } from '../../structures/Entitlement'; +import type { APIEntitlement } from '../../types'; export const ENTITLEMENT_CREATE = (client: UsingClient, data: APIEntitlement) => { return new Entitlement(client, data); diff --git a/src/events/hooks/guild.ts b/src/events/hooks/guild.ts index 052c218..62f542b 100644 --- a/src/events/hooks/guild.ts +++ b/src/events/hooks/guild.ts @@ -1,3 +1,11 @@ +import { + type GuildMemberStructure, + type GuildRoleStructure, + type GuildStructure, + Transformers, +} from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; import type { GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, @@ -21,14 +29,6 @@ import type { GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, } from '../../types'; -import { toCamelCase } from '../../common'; -import type { UsingClient } from '../../commands'; -import { - type GuildMemberStructure, - type GuildRoleStructure, - type GuildStructure, - Transformers, -} from '../../client/transformers'; export const GUILD_AUDIT_LOG_ENTRY_CREATE = (_self: UsingClient, data: GatewayGuildAuditLogEntryCreateDispatchData) => { return toCamelCase(data); diff --git a/src/events/hooks/integration.ts b/src/events/hooks/integration.ts index ca24e51..044721e 100644 --- a/src/events/hooks/integration.ts +++ b/src/events/hooks/integration.ts @@ -1,11 +1,11 @@ +import { Transformers } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; import type { GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, } from '../../types'; -import { toCamelCase } from '../../common'; -import type { UsingClient } from '../../commands'; -import { Transformers } from '../../client/transformers'; export const INTEGRATION_CREATE = (self: UsingClient, data: GatewayIntegrationCreateDispatchData) => { return data.user diff --git a/src/events/hooks/interactions.ts b/src/events/hooks/interactions.ts index d38681b..abec67d 100644 --- a/src/events/hooks/interactions.ts +++ b/src/events/hooks/interactions.ts @@ -1,6 +1,6 @@ -import type { GatewayInteractionCreateDispatchData } from '../../types'; -import { BaseInteraction } from '../../structures'; import type { UsingClient } from '../../commands'; +import { BaseInteraction } from '../../structures'; +import type { GatewayInteractionCreateDispatchData } from '../../types'; export const INTERACTION_CREATE = (self: UsingClient, data: GatewayInteractionCreateDispatchData) => { return BaseInteraction.from(self, data); diff --git a/src/events/hooks/invite.ts b/src/events/hooks/invite.ts index cd80479..14f469f 100644 --- a/src/events/hooks/invite.ts +++ b/src/events/hooks/invite.ts @@ -1,6 +1,6 @@ -import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from '../../types'; import type { UsingClient } from '../../commands'; import { toCamelCase } from '../../common'; +import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from '../../types'; export const INVITE_CREATE = (_self: UsingClient, data: GatewayInviteCreateDispatchData) => { return toCamelCase(data); diff --git a/src/events/hooks/message.ts b/src/events/hooks/message.ts index 4815311..1d5c3b4 100644 --- a/src/events/hooks/message.ts +++ b/src/events/hooks/message.ts @@ -1,3 +1,6 @@ +import { type MessageStructure, Transformers } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { type ObjectToLower, type OmitInsert, toCamelCase } from '../../common'; import type { GatewayMessageCreateDispatchData, GatewayMessageDeleteBulkDispatchData, @@ -9,9 +12,6 @@ import type { GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, } from '../../types'; -import { type OmitInsert, toCamelCase, type ObjectToLower } from '../../common'; -import type { UsingClient } from '../../commands'; -import { type MessageStructure, Transformers } from '../../client/transformers'; export const MESSAGE_CREATE = (self: UsingClient, data: GatewayMessageCreateDispatchData) => { return Transformers.Message(self, data); diff --git a/src/events/hooks/presence.ts b/src/events/hooks/presence.ts index cd20c80..25aa917 100644 --- a/src/events/hooks/presence.ts +++ b/src/events/hooks/presence.ts @@ -1,6 +1,6 @@ -import type { GatewayPresenceUpdateDispatchData } from '../../types'; import type { UsingClient } from '../../commands'; import { toCamelCase } from '../../common'; +import type { GatewayPresenceUpdateDispatchData } from '../../types'; export const PRESENCE_UPDATE = async (self: UsingClient, data: GatewayPresenceUpdateDispatchData) => { return [toCamelCase(data), await self.cache.presences?.get(data.user.id)] as const; diff --git a/src/events/hooks/stage.ts b/src/events/hooks/stage.ts index ef5592d..e2b5ee2 100644 --- a/src/events/hooks/stage.ts +++ b/src/events/hooks/stage.ts @@ -1,11 +1,11 @@ +import type { StageInstances } from '../../cache/resources/stage-instances'; +import type { UsingClient } from '../../commands'; +import { type ObjectToLower, toCamelCase } from '../../common'; import type { GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, } from '../../types'; -import type { UsingClient } from '../../commands'; -import { type ObjectToLower, toCamelCase } from '../../common'; -import type { StageInstances } from '../../cache/resources/stage-instances'; export const STAGE_INSTANCE_CREATE = (_self: UsingClient, data: GatewayStageInstanceCreateDispatchData) => { return toCamelCase(data); diff --git a/src/events/hooks/thread.ts b/src/events/hooks/thread.ts index a593ee4..b094378 100644 --- a/src/events/hooks/thread.ts +++ b/src/events/hooks/thread.ts @@ -1,3 +1,6 @@ +import { type ThreadChannelStructure, Transformers } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; import type { GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, @@ -6,9 +9,6 @@ import type { GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, } from '../../types'; -import { toCamelCase } from '../../common'; -import type { UsingClient } from '../../commands'; -import { type ThreadChannelStructure, Transformers } from '../../client/transformers'; export const THREAD_CREATE = (self: UsingClient, data: GatewayThreadCreateDispatchData) => { return Transformers.ThreadChannel(self, data); diff --git a/src/events/hooks/typing.ts b/src/events/hooks/typing.ts index b1c3ca8..082fb46 100644 --- a/src/events/hooks/typing.ts +++ b/src/events/hooks/typing.ts @@ -1,7 +1,7 @@ -import type { GatewayTypingStartDispatchData } from '../../types'; -import { toCamelCase } from '../../common'; -import type { UsingClient } from '../../commands'; import { Transformers } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; +import type { GatewayTypingStartDispatchData } from '../../types'; export const TYPING_START = (self: UsingClient, data: GatewayTypingStartDispatchData) => { return data.member diff --git a/src/events/hooks/user.ts b/src/events/hooks/user.ts index e470de3..bb62522 100644 --- a/src/events/hooks/user.ts +++ b/src/events/hooks/user.ts @@ -1,6 +1,6 @@ -import type { GatewayUserUpdateDispatchData } from '../../types'; -import type { UsingClient } from '../../commands'; import { Transformers, type UserStructure } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import type { GatewayUserUpdateDispatchData } from '../../types'; export const USER_UPDATE = async ( self: UsingClient, diff --git a/src/events/hooks/voice.ts b/src/events/hooks/voice.ts index 31abb7b..5555c44 100644 --- a/src/events/hooks/voice.ts +++ b/src/events/hooks/voice.ts @@ -1,11 +1,11 @@ +import { Transformers, type VoiceStateStructure } from '../../client/transformers'; +import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; import type { GatewayVoiceChannelEffectSendDispachData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, } from '../../types'; -import { toCamelCase } from '../../common'; -import type { UsingClient } from '../../commands'; -import { Transformers, type VoiceStateStructure } from '../../client/transformers'; export const VOICE_SERVER_UPDATE = (_self: UsingClient, data: GatewayVoiceServerUpdateDispatchData) => { return toCamelCase(data); diff --git a/src/events/hooks/webhook.ts b/src/events/hooks/webhook.ts index 5d0006c..42f0c69 100644 --- a/src/events/hooks/webhook.ts +++ b/src/events/hooks/webhook.ts @@ -1,6 +1,6 @@ -import type { GatewayWebhooksUpdateDispatchData } from '../../types'; -import { toCamelCase } from '../../common'; import type { UsingClient } from '../../commands'; +import { toCamelCase } from '../../common'; +import type { GatewayWebhooksUpdateDispatchData } from '../../types'; export const WEBHOOKS_UPDATE = (_self: UsingClient, data: GatewayWebhooksUpdateDispatchData) => { return toCamelCase(data); diff --git a/src/langs/handler.ts b/src/langs/handler.ts index 31fac14..7276044 100644 --- a/src/langs/handler.ts +++ b/src/langs/handler.ts @@ -1,7 +1,7 @@ -import { BaseHandler, isCloudfareWorker, magicImport } from '../common'; -import { LangRouter } from './router'; import type { FileLoaded } from '../commands/handler'; -import type { LocaleString, Locale } from '../types'; +import { BaseHandler, isCloudfareWorker, magicImport } from '../common'; +import type { Locale, LocaleString } from '../types'; +import { LangRouter } from './router'; export class LangsHandler extends BaseHandler { values: Partial> = {}; diff --git a/src/structures/Guild.ts b/src/structures/Guild.ts index e80e6d1..6c9d7ef 100644 --- a/src/structures/Guild.ts +++ b/src/structures/Guild.ts @@ -1,6 +1,8 @@ import type { UsingClient } from '../commands'; import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util'; +import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, RESTPatchAPIGuildJSONBody } from '../types'; import { AutoModerationRule } from './AutoModerationRule'; +import { GuildBan } from './GuildBan'; import { GuildEmoji } from './GuildEmoji'; import { GuildMember } from './GuildMember'; import { GuildRole } from './GuildRole'; @@ -9,8 +11,6 @@ import { Sticker } from './Sticker'; import { BaseChannel, WebhookGuildMethods } from './channels'; import { BaseGuild } from './extra/BaseGuild'; import type { DiscordBase } from './extra/DiscordBase'; -import { GuildBan } from './GuildBan'; -import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, RESTPatchAPIGuildJSONBody } from '../types'; export interface Guild extends ObjectToLower>, DiscordBase {} export class Guild extends (BaseGuild as unknown as ToClass< diff --git a/src/structures/GuildBan.ts b/src/structures/GuildBan.ts index 5143197..5722a7d 100644 --- a/src/structures/GuildBan.ts +++ b/src/structures/GuildBan.ts @@ -1,8 +1,8 @@ import type { UsingClient } from '../commands'; import { Formatter, type MethodContext, type ObjectToLower } from '../common'; -import { DiscordBase } from './extra/DiscordBase'; import type { BanShorter } from '../common/shorters/bans'; import type { APIBan, RESTGetAPIGuildBansQuery } from '../types'; +import { DiscordBase } from './extra/DiscordBase'; export interface GuildBan extends DiscordBase, ObjectToLower> {} diff --git a/src/structures/GuildEmoji.ts b/src/structures/GuildEmoji.ts index 37c23be..3842983 100644 --- a/src/structures/GuildEmoji.ts +++ b/src/structures/GuildEmoji.ts @@ -1,6 +1,6 @@ import type { BaseCDNUrlOptions } from '../api'; import type { UsingClient } from '../commands'; -import { Formatter, type EmojiShorter, type MethodContext, type ObjectToLower } from '../common'; +import { type EmojiShorter, Formatter, type MethodContext, type ObjectToLower } from '../common'; import type { APIEmoji, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildEmojiJSONBody } from '../types'; import { DiscordBase } from './extra/DiscordBase'; diff --git a/src/structures/GuildMember.ts b/src/structures/GuildMember.ts index 785a9cf..5d6398b 100644 --- a/src/structures/GuildMember.ts +++ b/src/structures/GuildMember.ts @@ -7,30 +7,30 @@ export type GuildMemberData = | GatewayGuildMemberAddDispatchData | APIInteractionDataResolvedGuildMember; -import type { - APIGuildMember, - GatewayGuildMemberUpdateDispatchData, - GatewayGuildMemberAddDispatchData, - APIInteractionDataResolvedGuildMember, - RESTPutAPIGuildBanJSONBody, - RESTPatchAPIGuildMemberJSONBody, - RESTGetAPIGuildMembersSearchQuery, - RESTPutAPIGuildMemberJSONBody, - RESTGetAPIGuildMembersQuery, - APIUser, -} from '../types'; +import { Transformers, type UserStructure } from '../client/transformers'; import type { UsingClient } from '../commands'; -import { PermissionsBitField } from './extra/Permissions'; import { Formatter, + type GuildMemberResolvable, + type ImageOptions, type MessageCreateBodyRequest, + type MethodContext, type ObjectToLower, type ToClass, - type ImageOptions, - type MethodContext, - type GuildMemberResolvable, } from '../common'; -import { Transformers, type UserStructure } from '../client/transformers'; +import type { + APIGuildMember, + APIInteractionDataResolvedGuildMember, + APIUser, + GatewayGuildMemberAddDispatchData, + GatewayGuildMemberUpdateDispatchData, + RESTGetAPIGuildMembersQuery, + RESTGetAPIGuildMembersSearchQuery, + RESTPatchAPIGuildMemberJSONBody, + RESTPutAPIGuildBanJSONBody, + RESTPutAPIGuildMemberJSONBody, +} from '../types'; +import { PermissionsBitField } from './extra/Permissions'; export interface BaseGuildMember extends DiscordBase, ObjectToLower> {} export class BaseGuildMember extends DiscordBase { diff --git a/src/structures/GuildRole.ts b/src/structures/GuildRole.ts index 60c2887..923428e 100644 --- a/src/structures/GuildRole.ts +++ b/src/structures/GuildRole.ts @@ -1,11 +1,11 @@ +import type { UsingClient } from '../commands'; +import { Formatter, type MethodContext, type ObjectToLower } from '../common'; import type { APIRole, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPostAPIGuildRoleJSONBody, } from '../types'; -import type { UsingClient } from '../commands'; -import { Formatter, type MethodContext, type ObjectToLower } from '../common'; import { DiscordBase } from './extra/DiscordBase'; import { PermissionsBitField } from './extra/Permissions'; diff --git a/src/structures/GuildTemplate.ts b/src/structures/GuildTemplate.ts index 3842bd8..93077c7 100644 --- a/src/structures/GuildTemplate.ts +++ b/src/structures/GuildTemplate.ts @@ -1,6 +1,6 @@ -import type { APITemplate, RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from '../types'; import type { UsingClient } from '../commands'; import type { MethodContext, ObjectToLower } from '../common'; +import type { APITemplate, RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from '../types'; import { Base } from './extra/Base'; export interface GuildTemplate extends Base, ObjectToLower {} diff --git a/src/structures/Message.ts b/src/structures/Message.ts index e3e3f8d..84387ff 100644 --- a/src/structures/Message.ts +++ b/src/structures/Message.ts @@ -1,3 +1,18 @@ +import { Embed } from '..'; +import type { ListenerOptions } from '../builders'; +import { + type GuildMemberStructure, + type PollStructure, + Transformers, + type UserStructure, +} from '../client/transformers'; +import type { UsingClient } from '../commands'; +import { type ObjectToLower, toCamelCase } from '../common'; +import { Formatter } from '../common'; +import type { EmojiResolvable } from '../common/types/resolvables'; +import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write'; +import type { ActionRowMessageComponents } from '../components'; +import { MessageActionRowComponent } from '../components/ActionRow'; import type { APIChannelMention, APIEmbed, @@ -6,23 +21,8 @@ import type { APIUser, GatewayMessageCreateDispatchData, } from '../types'; -import type { ListenerOptions } from '../builders'; -import type { UsingClient } from '../commands'; -import { toCamelCase, type ObjectToLower } from '../common'; -import type { EmojiResolvable } from '../common/types/resolvables'; -import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write'; -import type { ActionRowMessageComponents } from '../components'; -import { MessageActionRowComponent } from '../components/ActionRow'; import type { MessageWebhookMethodEditParams, MessageWebhookMethodWriteParams } from './Webhook'; import { DiscordBase } from './extra/DiscordBase'; -import { Formatter } from '../common'; -import { Embed } from '..'; -import { - type PollStructure, - Transformers, - type GuildMemberStructure, - type UserStructure, -} from '../client/transformers'; export type MessageData = APIMessage | GatewayMessageCreateDispatchData; diff --git a/src/structures/Poll.ts b/src/structures/Poll.ts index f772ee6..3ddf151 100644 --- a/src/structures/Poll.ts +++ b/src/structures/Poll.ts @@ -1,8 +1,8 @@ -import type { APIPoll } from '../types'; -import { toCamelCase, type ObjectToLower } from '../common'; -import { Base } from './extra/Base'; -import type { UsingClient } from '../commands'; import type { ValidAnswerId } from '../api/Routes/channels'; +import type { UsingClient } from '../commands'; +import { type ObjectToLower, toCamelCase } from '../common'; +import type { APIPoll } from '../types'; +import { Base } from './extra/Base'; export interface Poll extends ObjectToLower {} diff --git a/src/structures/Sticker.ts b/src/structures/Sticker.ts index 5e7a2e6..0784a9b 100644 --- a/src/structures/Sticker.ts +++ b/src/structures/Sticker.ts @@ -1,9 +1,9 @@ -import type { APISticker, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../types'; import type { RawFile, UsingClient } from '..'; import type { Attachment, AttachmentBuilder } from '../builders'; -import type { MethodContext, ObjectToLower } from '../common'; -import { DiscordBase } from './extra/DiscordBase'; import { Transformers, type UserStructure } from '../client/transformers'; +import type { MethodContext, ObjectToLower } from '../common'; +import type { APISticker, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../types'; +import { DiscordBase } from './extra/DiscordBase'; export interface Sticker extends DiscordBase, ObjectToLower> {} diff --git a/src/structures/Webhook.ts b/src/structures/Webhook.ts index 9acb42d..3df107b 100644 --- a/src/structures/Webhook.ts +++ b/src/structures/Webhook.ts @@ -1,3 +1,13 @@ +import { type AnonymousGuildStructure, Transformers, type UserStructure } from '../client/transformers'; +import type { UsingClient } from '../commands'; +import type { + ImageOptions, + MessageWebhookCreateBodyRequest, + MessageWebhookPayload, + MessageWebhookUpdateBodyRequest, + MethodContext, + ObjectToLower, +} from '../common'; /** * Represents a Discord webhook. */ @@ -8,17 +18,7 @@ import type { RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, } from '../types'; -import type { UsingClient } from '../commands'; -import type { - ImageOptions, - MessageWebhookCreateBodyRequest, - MessageWebhookPayload, - MessageWebhookUpdateBodyRequest, - MethodContext, - ObjectToLower, -} from '../common'; import { DiscordBase } from './extra/DiscordBase'; -import { type AnonymousGuildStructure, Transformers, type UserStructure } from '../client/transformers'; export interface Webhook extends DiscordBase, ObjectToLower> {} diff --git a/src/structures/extra/BaseGuild.ts b/src/structures/extra/BaseGuild.ts index 159d0b6..c2fb79c 100644 --- a/src/structures/extra/BaseGuild.ts +++ b/src/structures/extra/BaseGuild.ts @@ -1,5 +1,5 @@ import type { WorkerClient } from '../..'; -import { calculateShardId, type ObjectToLower } from '../../common'; +import { type ObjectToLower, calculateShardId } from '../../common'; import type { ImageOptions } from '../../common/types/options'; import { type APIPartialGuild, GuildFeature } from '../../types'; import type { ShardManager } from '../../websocket'; diff --git a/src/structures/extra/DiscordBase.ts b/src/structures/extra/DiscordBase.ts index f5bca82..4c80c14 100644 --- a/src/structures/extra/DiscordBase.ts +++ b/src/structures/extra/DiscordBase.ts @@ -1,6 +1,6 @@ import type { UsingClient } from '../../commands'; -import { Base } from './Base'; import { snowflakeToTimestamp } from '../../common/it/utils'; +import { Base } from './Base'; export class DiscordBase = { id: string }> extends Base { id: string; diff --git a/src/types/gateway.ts b/src/types/gateway.ts index 89f70db..c7d874b 100644 --- a/src/types/gateway.ts +++ b/src/types/gateway.ts @@ -1,39 +1,39 @@ // https://github.com/discordjs/discord-api-types/blob/main/gateway/v10.ts -import type { Snowflake, ChannelType, GatewayDispatchEvents, GatewayOpcodes } from './index'; +import type { ChannelType, GatewayDispatchEvents, GatewayOpcodes, Snowflake } from './index'; import type { GatewayPresenceUpdate } from './payloads/gateway'; import type { APIApplication, APIApplicationCommandPermission, - APIAutoModerationRule, + APIAuditLogEntry, APIAutoModerationAction, + APIAutoModerationRule, APIChannel, APIEmoji, + APIEntitlement, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, + APIPartialEmoji, APIRole, APIStageInstance, APISticker, + APISubscription, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, + APIVoiceState, + AutoModerationRuleTriggerType, GatewayActivity, + InviteTargetType, + PresenceUpdateStatus, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, - APIVoiceState, - InviteTargetType, - PresenceUpdateStatus, - AutoModerationRuleTriggerType, - APIAuditLogEntry, - APIEntitlement, - APIPartialEmoji, - APISubscription, } from './payloads/index'; import type { ReactionType } from './rest/index'; import type { AnimationTypes, Nullable } from './utils'; diff --git a/src/types/payloads/_interactions/base.ts b/src/types/payloads/_interactions/base.ts index 19692a0..16f14b7 100644 --- a/src/types/payloads/_interactions/base.ts +++ b/src/types/payloads/_interactions/base.ts @@ -1,4 +1,4 @@ -import type { InteractionContextType, ApplicationIntegrationType } from '..'; +import type { ApplicationIntegrationType, InteractionContextType } from '..'; import type { ChannelType, Snowflake } from '../..'; import type { LocaleString } from '../../rest'; diff --git a/src/types/payloads/channel.ts b/src/types/payloads/channel.ts index 2992ba3..3482eb0 100644 --- a/src/types/payloads/channel.ts +++ b/src/types/payloads/channel.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/channel */ -import type { Permissions, Snowflake, ChannelType, OverwriteType, VideoQualityMode } from '../index'; +import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '../index'; import type { APIApplication } from './application'; import type { APIPartialEmoji } from './emoji'; import type { APIGuildMember } from './guild'; diff --git a/src/types/payloads/guild.ts b/src/types/payloads/guild.ts index 6ad140d..7c8350d 100644 --- a/src/types/payloads/guild.ts +++ b/src/types/payloads/guild.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { Permissions, Snowflake, GuildMemberFlags } from '../index'; +import type { GuildMemberFlags, Permissions, Snowflake } from '../index'; import type { APIEmoji, APIPartialEmoji } from './emoji'; import type { PresenceUpdateReceiveStatus } from './gateway'; import type { OAuth2Scopes } from './oauth2'; diff --git a/src/types/rest/application.ts b/src/types/rest/application.ts index c045cf7..f762090 100644 --- a/src/types/rest/application.ts +++ b/src/types/rest/application.ts @@ -1,6 +1,6 @@ -import type { APIApplicationRoleConnectionMetadata, APIApplication, APIEmoji } from '../payloads'; -import type { StrictPartial, Nullable } from '../utils'; -import type { RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody } from './emoji'; +import type { APIApplication, APIApplicationRoleConnectionMetadata, APIEmoji } from '../payloads'; +import type { Nullable, StrictPartial } from '../utils'; +import type { RESTPatchAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiJSONBody } from './emoji'; /** * https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records diff --git a/src/types/rest/auditLog.ts b/src/types/rest/auditLog.ts index 37a5654..62d3026 100644 --- a/src/types/rest/auditLog.ts +++ b/src/types/rest/auditLog.ts @@ -1,5 +1,5 @@ import type { Snowflake } from '..'; -import type { AuditLogEvent, APIAuditLog } from '../payloads'; +import type { APIAuditLog, AuditLogEvent } from '../payloads'; /** * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log diff --git a/src/types/rest/channel.ts b/src/types/rest/channel.ts index cec88df..35acb3c 100644 --- a/src/types/rest/channel.ts +++ b/src/types/rest/channel.ts @@ -1,28 +1,28 @@ -import type { Snowflake, ChannelType, VideoQualityMode, OverwriteType, Permissions } from '..'; +import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '..'; import type { - APIChannel, - ThreadAutoArchiveDuration, - ChannelFlags, - APIGuildForumTag, - APIGuildForumDefaultReactionEmoji, - SortOrderType, - ForumLayoutType, - APIMessage, - APIMessageReference, - APIEmbed, - APIAllowedMentions, APIActionRowComponent, - APIMessageActionRowComponent, - MessageFlags, - APIUser, - APIExtendedInvite, - InviteTargetType, - APIFollowedChannel, - ThreadChannelType, - APIThreadMember, - APIThreadList, + APIAllowedMentions, APIAttachment, + APIChannel, + APIEmbed, + APIExtendedInvite, + APIFollowedChannel, + APIGuildForumDefaultReactionEmoji, + APIGuildForumTag, + APIMessage, + APIMessageActionRowComponent, + APIMessageReference, + APIThreadList, + APIThreadMember, + APIUser, + ChannelFlags, + ForumLayoutType, + InviteTargetType, + MessageFlags, + SortOrderType, + ThreadAutoArchiveDuration, + ThreadChannelType, } from '../payloads'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../utils'; import type { RESTAPIPollCreate } from './poll'; diff --git a/src/types/rest/guild.ts b/src/types/rest/guild.ts index 9f0a49b..2056727 100644 --- a/src/types/rest/guild.ts +++ b/src/types/rest/guild.ts @@ -1,39 +1,39 @@ import type { Snowflake } from '..'; import type { + APIBan, APIChannel, APIDMChannel, - APIGroupDMChannel, - GuildVerificationLevel, - GuildDefaultMessageNotifications, - GuildExplicitContentFilter, - GuildSystemChannelFlags, - APIGuild, - GuildMFALevel, - APIGuildPreview, - GuildFeature, - APIThreadList, - APIGuildMember, - APIBan, - APIRole, - APIVoiceRegion, APIExtendedInvite, + APIGroupDMChannel, + APIGuild, APIGuildIntegration, - APIGuildWidgetSettings, - APIGuildWidget, - GuildWidgetStyle, + APIGuildMember, APIGuildMembershipScreening, - APIGuildWelcomeScreen, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, + APIGuildPreview, + APIGuildWelcomeScreen, + APIGuildWidget, + APIGuildWidgetSettings, + APIRole, + APIThreadList, + APIVoiceRegion, + GuildDefaultMessageNotifications, + GuildExplicitContentFilter, + GuildFeature, + GuildMFALevel, + GuildSystemChannelFlags, + GuildVerificationLevel, + GuildWidgetStyle, } from '../payloads'; import type { - StrictPartial, - DistributivePick, - DistributiveOmit, - StrictRequired, - Nullable, AddUndefinedToPossiblyUndefinedPropertiesOfInterface, + DistributiveOmit, + DistributivePick, + Nullable, + StrictPartial, + StrictRequired, } from '../utils'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel'; diff --git a/src/types/rest/guildScheduledEvent.ts b/src/types/rest/guildScheduledEvent.ts index a47bef2..3bf0f51 100644 --- a/src/types/rest/guildScheduledEvent.ts +++ b/src/types/rest/guildScheduledEvent.ts @@ -1,11 +1,11 @@ import type { Snowflake } from '..'; import type { APIGuildScheduledEvent, - GuildScheduledEventPrivacyLevel, - GuildScheduledEventEntityType, APIGuildScheduledEventEntityMetadata, - GuildScheduledEventStatus, APIGuildScheduledEventUser, + GuildScheduledEventEntityType, + GuildScheduledEventPrivacyLevel, + GuildScheduledEventStatus, } from '../payloads'; import type { StrictPartial } from '../utils'; diff --git a/src/types/rest/oauth2.ts b/src/types/rest/oauth2.ts index 02b54a8..8b55937 100644 --- a/src/types/rest/oauth2.ts +++ b/src/types/rest/oauth2.ts @@ -1,5 +1,5 @@ import type { Snowflake } from '..'; -import type { APIApplication, OAuth2Scopes, APIUser, APIGuild, APIWebhook } from '../payloads'; +import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads'; /** * https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information diff --git a/src/types/rest/poll.ts b/src/types/rest/poll.ts index 41c5cda..4e98463 100644 --- a/src/types/rest/poll.ts +++ b/src/types/rest/poll.ts @@ -1,4 +1,4 @@ -import type { Snowflake, APIMessage, APIPoll, APIPollAnswer, APIUser } from '../index'; +import type { APIMessage, APIPoll, APIPollAnswer, APIUser, Snowflake } from '../index'; /** * https://discord.com/developers/docs/resources/poll#get-answer-voters diff --git a/src/types/rest/stageInstance.ts b/src/types/rest/stageInstance.ts index bf80893..0b8e13f 100644 --- a/src/types/rest/stageInstance.ts +++ b/src/types/rest/stageInstance.ts @@ -1,5 +1,5 @@ import type { Snowflake } from '..'; -import type { StageInstancePrivacyLevel, APIStageInstance } from '../payloads'; +import type { APIStageInstance, StageInstancePrivacyLevel } from '../payloads'; /** * https://discord.com/developers/docs/resources/stage-instance#create-stage-instance diff --git a/src/types/rest/template.ts b/src/types/rest/template.ts index fb51e8b..47abd9c 100644 --- a/src/types/rest/template.ts +++ b/src/types/rest/template.ts @@ -1,4 +1,4 @@ -import type { APITemplate, APIGuild } from '../payloads'; +import type { APIGuild, APITemplate } from '../payloads'; import type { StrictPartial } from '../utils'; /** diff --git a/src/types/rest/user.ts b/src/types/rest/user.ts index 06b7252..fd9aa92 100644 --- a/src/types/rest/user.ts +++ b/src/types/rest/user.ts @@ -1,11 +1,11 @@ import type { Snowflake } from '..'; import type { - APIUser, - APIGuildMember, - GuildFeature, + APIApplicationRoleConnection, APIChannel, APIConnection, - APIApplicationRoleConnection, + APIGuildMember, + APIUser, + GuildFeature, } from '../payloads'; /** diff --git a/src/types/rest/webhook.ts b/src/types/rest/webhook.ts index 0aa21d2..dfe230c 100644 --- a/src/types/rest/webhook.ts +++ b/src/types/rest/webhook.ts @@ -1,12 +1,12 @@ import type { Snowflake } from '..'; import type { - APIWebhook, - APIEmbed, - APIAllowedMentions, APIActionRowComponent, - APIMessageActionRowComponent, - MessageFlags, + APIAllowedMentions, + APIEmbed, APIMessage, + APIMessageActionRowComponent, + APIWebhook, + MessageFlags, } from '../payloads'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../utils'; import type { RESTAPIAttachment } from './channel'; diff --git a/src/websocket/SharedTypes.ts b/src/websocket/SharedTypes.ts index 4f44501..77452ab 100644 --- a/src/websocket/SharedTypes.ts +++ b/src/websocket/SharedTypes.ts @@ -1,66 +1,66 @@ import type { RestToKeys } from '../common'; import type { - GatewayActivity, - PresenceUpdateStatus, - GatewayPresenceUpdateData, - GatewayRequestGuildMembersDataWithQuery, - GatewayRequestGuildMembersDataWithUserIds, - APIGuildMember, - APIUser, - GatewayReadyDispatchData, - GatewayChannelUpdateDispatchData, - GatewayAutoModerationActionExecutionDispatchData, - GatewayThreadCreateDispatchData, - GatewayThreadDeleteDispatchData, - GatewayThreadListSyncDispatchData, - GatewayThreadMemberUpdateDispatchData, - GatewayThreadMembersUpdateDispatchData, - GatewayChannelPinsUpdateDispatchData, - GatewayGuildCreateDispatchData, - APIGuild, - GatewayGuildDeleteDispatchData, APIAuditLogEntry, + APIAutoModerationRule, + APIChannel, + APIEntitlement, + APIGuild, + APIGuildMember, + APIGuildScheduledEvent, + APIStageInstance, + APISubscription, + APIUser, + GatewayActivity, + GatewayAutoModerationActionExecutionDispatchData, + GatewayChannelPinsUpdateDispatchData, + GatewayChannelUpdateDispatchData, + GatewayEntitlementCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, + GatewayGuildCreateDispatchData, + GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, - GatewayGuildStickersUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, - GatewayGuildRoleUpdateDispatchData, GatewayGuildRoleDeleteDispatchData, + GatewayGuildRoleUpdateDispatchData, + GatewayGuildScheduledEventUserRemoveDispatchData, + GatewayGuildStickersUpdateDispatchData, + GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, + GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, - GatewayMessageUpdateDispatchData, - GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, + GatewayMessageDeleteDispatchData, + GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, - GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, + GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, + GatewayMessageUpdateDispatchData, + GatewayPresenceUpdateData, GatewayPresenceUpdateDispatchData, + GatewayReadyDispatchData, + GatewayRequestGuildMembersDataWithQuery, + GatewayRequestGuildMembersDataWithUserIds, + GatewayThreadCreateDispatchData, + GatewayThreadDeleteDispatchData, + GatewayThreadListSyncDispatchData, + GatewayThreadMemberUpdateDispatchData, + GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, - GatewayVoiceStateUpdateData, - GatewayVoiceServerUpdateDispatchData, - GatewayWebhooksUpdateDispatchData, - GatewayInteractionCreateDispatchData, - APIStageInstance, - GatewayMessagePollVoteDispatchData, - GatewayIntegrationCreateDispatchData, - GatewayGuildScheduledEventUserRemoveDispatchData, - APIGuildScheduledEvent, - APIChannel, - APIAutoModerationRule, - APIEntitlement, GatewayVoiceChannelEffectSendDispachData, - APISubscription, - GatewayEntitlementCreateDispatchData, + GatewayVoiceServerUpdateDispatchData, + GatewayVoiceStateUpdateData, + GatewayWebhooksUpdateDispatchData, + PresenceUpdateStatus, } from '../types'; import { GatewayDispatchEvents } from '../types'; diff --git a/src/websocket/structures/index.ts b/src/websocket/structures/index.ts index 841fd12..8c6b07c 100644 --- a/src/websocket/structures/index.ts +++ b/src/websocket/structures/index.ts @@ -1,4 +1,4 @@ -import { delay, type Logger } from '../../common'; +import { type Logger, delay } from '../../common'; /** * options of the dynamic bucket