diff --git a/package.json b/package.json index 5104c09..2c58dbe 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "main": "./lib/index.js", "module": "./lib/index.js", "types": "./lib/index.d.ts", - "files": ["lib/**"], + "files": [ + "lib/**" + ], "scripts": { "build": "tsc --outDir ./lib", "prepublishOnly": "npm run build", @@ -25,7 +27,10 @@ "ws": "^8.16.0" }, "lint-staged": { - "*.ts": ["biome check --apply", "biome format --write"] + "*.ts": [ + "biome check --apply", + "biome format --write" + ] }, "devDependencies": { "@biomejs/biome": "1.6.0", @@ -50,7 +55,13 @@ "bugs": { "url": "https://github.com/tiramisulabs/seyfert" }, - "keywords": ["api", "discord", "bots", "typescript", "botdev"], + "keywords": [ + "api", + "discord", + "bots", + "typescript", + "botdev" + ], "publishConfig": { "access": "public" }, @@ -59,5 +70,22 @@ "name": "socram03", "url": "https://github.com/socram03" } - ] + ], + "exports": { + ".": "./lib/index.js", + "./api": "./lib/api/index.js", + "./builders": "./lib/builders/index.js", + "./cache": "./lib/cache/index.js", + "./client": "./lib/client/index.js", + "./commands": "./lib/commands/index.js", + "./common": "./lib/common/index.js", + "./components": "./lib/components/index.js", + "./events": "./lib/events/index.js", + "./langs": "./lib/langs/index.js", + "./structures": "./lib/structures/index.js", + "./websocket": "./lib/websocket/index.js", + "./collection": "./lib/collection.js", + "./package.json": "./package.json", + "./dapi": "./lib/types/index.js" + } } diff --git a/src/api/Routes/applications.ts b/src/api/Routes/applications.ts index 97d32a2..a43751b 100644 --- a/src/api/Routes/applications.ts +++ b/src/api/Routes/applications.ts @@ -23,9 +23,9 @@ import type { RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPutAPIGuildApplicationCommandsPermissionsResult, -} from '../../common'; -import type { RestArguments } from '../api'; +} from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface ApplicationRoutes { applications: (id: string) => { diff --git a/src/api/Routes/channels.ts b/src/api/Routes/channels.ts index ad8a86a..2c893b0 100644 --- a/src/api/Routes/channels.ts +++ b/src/api/Routes/channels.ts @@ -52,9 +52,9 @@ import type { RESTPutAPIChannelRecipientJSONBody, RESTPutAPIChannelRecipientResult, RESTPutAPIChannelThreadMembersResult, -} from '../../common'; -import type { RestArguments } from '../api'; +} from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface ChannelRoutes { channels(id: string): { diff --git a/src/api/Routes/gateway.ts b/src/api/Routes/gateway.ts index d680436..0cc1455 100644 --- a/src/api/Routes/gateway.ts +++ b/src/api/Routes/gateway.ts @@ -1,6 +1,6 @@ -import type { RESTGetAPIGatewayBotResult, RESTGetAPIGatewayResult } from '../../common'; -import type { RestArguments } from '../api'; +import type { RESTGetAPIGatewayBotResult, RESTGetAPIGatewayResult } from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface GatewayRoutes { gateway: { diff --git a/src/api/Routes/guilds.ts b/src/api/Routes/guilds.ts index ef93ae6..49fece8 100644 --- a/src/api/Routes/guilds.ts +++ b/src/api/Routes/guilds.ts @@ -1,7 +1,5 @@ import type { APIThreadChannel, - Identify, - OmitInsert, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, @@ -112,7 +110,8 @@ import type { RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildTemplateSyncResult, -} from '../../common'; +} from 'discord-api-types/v10'; +import type { Identify, OmitInsert } from '../../common'; import type { ProxyRequestMethod } from '../Router'; import type { RestArguments } from '../api'; import type { RawFile } from '../shared'; diff --git a/src/api/Routes/interactions.ts b/src/api/Routes/interactions.ts index bf0aba8..932e22e 100644 --- a/src/api/Routes/interactions.ts +++ b/src/api/Routes/interactions.ts @@ -1,6 +1,6 @@ -import type { RESTPostAPIInteractionCallbackJSONBody } from '../../common'; -import type { RestArguments } from '../api'; +import type { RESTPostAPIInteractionCallbackJSONBody } from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface InteractionRoutes { interactions: (id: string) => (token: string) => { diff --git a/src/api/Routes/invites.ts b/src/api/Routes/invites.ts index 68c7951..1ea51e5 100644 --- a/src/api/Routes/invites.ts +++ b/src/api/Routes/invites.ts @@ -1,6 +1,6 @@ -import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from '../../common'; -import type { RestArguments } from '../api'; +import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface InviteRoutes { invites(id: string): { diff --git a/src/api/Routes/stage-instances.ts b/src/api/Routes/stage-instances.ts index dc0220a..74bc74a 100644 --- a/src/api/Routes/stage-instances.ts +++ b/src/api/Routes/stage-instances.ts @@ -5,9 +5,9 @@ import type { RESTPatchAPIStageInstanceResult, RESTPostAPIStageInstanceJSONBody, RESTPostAPIStageInstanceResult, -} from '../../common'; -import type { RestArguments } from '../api'; +} from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface StageInstanceRoutes { 'stage-instances': { diff --git a/src/api/Routes/stickers.ts b/src/api/Routes/stickers.ts index 133e194..cb1f6dc 100644 --- a/src/api/Routes/stickers.ts +++ b/src/api/Routes/stickers.ts @@ -1,6 +1,6 @@ -import type { RESTGetAPIStickerResult, RESTGetNitroStickerPacksResult } from '../../common'; -import type { RestArguments } from '../api'; +import type { RESTGetAPIStickerResult, RESTGetNitroStickerPacksResult } from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface StickerRoutes { stickers(id: string): { diff --git a/src/api/Routes/users.ts b/src/api/Routes/users.ts index ea9cd25..a47dc8b 100644 --- a/src/api/Routes/users.ts +++ b/src/api/Routes/users.ts @@ -13,9 +13,9 @@ import type { RESTPostAPICurrentUserCreateDMChannelJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult, -} from '../../common'; -import type { RestArguments } from '../api'; +} from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface UserRoutes { users: { diff --git a/src/api/Routes/voice.ts b/src/api/Routes/voice.ts index 48a4f7e..4d20d50 100644 --- a/src/api/Routes/voice.ts +++ b/src/api/Routes/voice.ts @@ -1,6 +1,6 @@ -import type { RESTGetAPIVoiceRegionsResult } from '../../common'; -import type { RestArguments } from '../api'; +import type { RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface VoiceRoutes { voice: { diff --git a/src/api/Routes/webhooks.ts b/src/api/Routes/webhooks.ts index bb29d96..ebb3758 100644 --- a/src/api/Routes/webhooks.ts +++ b/src/api/Routes/webhooks.ts @@ -21,9 +21,9 @@ import type { RESTPostAPIWebhookWithTokenSlackResult, RESTPostAPIWebhookWithTokenSlackWaitResult, RESTPostAPIWebhookWithTokenWaitResult, -} from '../../common'; -import type { RestArguments } from '../api'; +} from 'discord-api-types/v10'; import type { ProxyRequestMethod } from '../Router'; +import type { RestArguments } from '../api'; export interface WebhookRoutes { webhooks(id: string): { diff --git a/src/builders/ActionRow.ts b/src/builders/ActionRow.ts index 29308cc..3819155 100644 --- a/src/builders/ActionRow.ts +++ b/src/builders/ActionRow.ts @@ -3,8 +3,8 @@ import { type APIActionRowComponent, type APIActionRowComponentTypes, type APIMessageActionRowComponent, - type RestOrArray, -} from '../common'; +} from 'discord-api-types/v10'; +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/Base.ts b/src/builders/Base.ts index b520869..3554de4 100644 --- a/src/builders/Base.ts +++ b/src/builders/Base.ts @@ -1,4 +1,4 @@ -import type { APIBaseComponent, ComponentType } from '../common'; +import type { APIBaseComponent, ComponentType } from 'discord-api-types/v10'; export abstract class BaseComponentBuilder< TYPE extends Partial> = APIBaseComponent, diff --git a/src/builders/Button.ts b/src/builders/Button.ts index 0ce5ed1..3588ad7 100644 --- a/src/builders/Button.ts +++ b/src/builders/Button.ts @@ -1,13 +1,12 @@ -import { throwError } from '..'; import { - ComponentType, type APIButtonComponentWithCustomId, type APIButtonComponentWithURL, type APIMessageComponentEmoji, type ButtonStyle, - type EmojiResolvable, - type When, -} from '../common'; + ComponentType, +} from 'discord-api-types/v10'; +import { throwError } from '..'; +import type { EmojiResolvable, When } from '../common'; import { resolvePartialEmoji } from '../structures/extra/functions'; export type ButtonStylesForID = Exclude; diff --git a/src/builders/Embed.ts b/src/builders/Embed.ts index 33eaeda..469c61f 100644 --- a/src/builders/Embed.ts +++ b/src/builders/Embed.ts @@ -1,14 +1,5 @@ -import { - resolveColor, - toSnakeCase, - type APIEmbed, - type APIEmbedAuthor, - type APIEmbedField, - type APIEmbedFooter, - type ColorResolvable, - type ObjectToLower, - type RestOrArray, -} from '../common'; +import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter } from 'discord-api-types/v10'; +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 ad762d6..8961ce9 100644 --- a/src/builders/Modal.ts +++ b/src/builders/Modal.ts @@ -1,11 +1,11 @@ import { - ComponentType, type APIActionRowComponent, type APIModalInteractionResponseCallbackData, type APITextInputComponent, - type RestOrArray, + ComponentType, type TextInputStyle, -} from '../common'; +} from 'discord-api-types/v10'; +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/SelectMenu.ts b/src/builders/SelectMenu.ts index 2d9f378..296d00c 100644 --- a/src/builders/SelectMenu.ts +++ b/src/builders/SelectMenu.ts @@ -1,7 +1,4 @@ -import { throwError } from '..'; import { - ComponentType, - SelectMenuDefaultValueType, type APIChannelSelectComponent, type APIMentionableSelectComponent, type APIMessageComponentEmoji, @@ -12,10 +9,11 @@ import { type APIStringSelectComponent, type APIUserSelectComponent, type ChannelType, - type EmojiResolvable, - type RestOrArray, - type ToClass, -} from '../common'; + ComponentType, + SelectMenuDefaultValueType, +} from 'discord-api-types/v10'; +import { throwError } from '..'; +import type { EmojiResolvable, RestOrArray, ToClass } from '../common'; import type { ChannelSelectMenuInteraction, ComponentInteraction, diff --git a/src/builders/index.ts b/src/builders/index.ts index f72ccf8..b2ecc7f 100644 --- a/src/builders/index.ts +++ b/src/builders/index.ts @@ -1,4 +1,4 @@ -import { ComponentType, type APIActionRowComponent, type APIActionRowComponentTypes } from '../common'; +import { type APIActionRowComponent, type APIActionRowComponentTypes, ComponentType } from 'discord-api-types/v10'; import { ActionRow } from './ActionRow'; import { Button } from './Button'; import { TextInput } from './Modal'; diff --git a/src/cache/index.ts b/src/cache/index.ts index 6248f05..6f427ed 100644 --- a/src/cache/index.ts +++ b/src/cache/index.ts @@ -1,11 +1,4 @@ -import type { - APIEmoji, - APISticker, - APIThreadChannel, - GatewayDispatchPayload, - GatewayReadyDispatchData, - If, -} from '../common'; +import type { If } from '../common'; import type { Adapter } from './adapters'; @@ -22,8 +15,16 @@ import { Stickers } from './resources/stickers'; import { Threads } from './resources/threads'; import { VoiceStates } from './resources/voice-states'; +import { + type APIEmoji, + type APISticker, + type APIThreadChannel, + ChannelType, + type GatewayDispatchPayload, + GatewayIntentBits, + type GatewayReadyDispatchData, +} from 'discord-api-types/v10'; import type { InternalOptions, UsingClient } from '../commands'; -import { ChannelType, GatewayIntentBits } from '../common'; import { Overwrites } from './resources/overwrites'; export type InferAsyncCache = InternalOptions extends { asyncCache: infer P } ? P : false; diff --git a/src/cache/resources/default/base.ts b/src/cache/resources/default/base.ts index 4ec86ee..0704f32 100644 --- a/src/cache/resources/default/base.ts +++ b/src/cache/resources/default/base.ts @@ -1,6 +1,7 @@ +import type { GatewayIntentBits } from 'discord-api-types/v10'; import type { BaseClient } from '../../../client/base'; import type { UsingClient } from '../../../commands'; -import { fakePromise, type GatewayIntentBits } from '../../../common'; +import { fakePromise } from '../../../common'; import type { Cache, ReturnCache } from '../../index'; export class BaseResource { diff --git a/src/cache/resources/default/guild-based.ts b/src/cache/resources/default/guild-based.ts index f274136..da13799 100644 --- a/src/cache/resources/default/guild-based.ts +++ b/src/cache/resources/default/guild-based.ts @@ -1,6 +1,7 @@ +import type { GatewayIntentBits } from 'discord-api-types/v10'; import type { BaseClient } from '../../../client/base'; import type { UsingClient } from '../../../commands'; -import { fakePromise, type GatewayIntentBits } from '../../../common'; +import { fakePromise } from '../../../common'; import type { Cache, ReturnCache } from '../../index'; export class GuildBasedResource { diff --git a/src/cache/resources/default/guild-related.ts b/src/cache/resources/default/guild-related.ts index 29a0326..dd40449 100644 --- a/src/cache/resources/default/guild-related.ts +++ b/src/cache/resources/default/guild-related.ts @@ -1,6 +1,7 @@ +import type { GatewayIntentBits } from 'discord-api-types/v10'; import type { BaseClient } from '../../../client/base'; import type { UsingClient } from '../../../commands'; -import { fakePromise, type GatewayIntentBits } from '../../../common'; +import { fakePromise } from '../../../common'; import type { Cache, ReturnCache } from '../../index'; export class GuildRelatedResource { diff --git a/src/cache/resources/emojis.ts b/src/cache/resources/emojis.ts index 05a8d32..4a63b9e 100644 --- a/src/cache/resources/emojis.ts +++ b/src/cache/resources/emojis.ts @@ -1,5 +1,6 @@ +import type { APIEmoji } from 'discord-api-types/v10'; import type { ReturnCache } from '../..'; -import { fakePromise, type APIEmoji } from '../../common'; +import { fakePromise } from '../../common'; import { GuildEmoji } from '../../structures'; import { GuildRelatedResource } from './default/guild-related'; diff --git a/src/cache/resources/guilds.ts b/src/cache/resources/guilds.ts index 7e08693..d534116 100644 --- a/src/cache/resources/guilds.ts +++ b/src/cache/resources/guilds.ts @@ -1,5 +1,6 @@ +import type { APIGuild } from 'discord-api-types/v10'; import type { Cache, ReturnCache } from '..'; -import { fakePromise, type APIGuild } from '../../common'; +import { fakePromise } from '../../common'; import { Guild } from '../../structures'; import { BaseResource } from './default/base'; diff --git a/src/cache/resources/presence.ts b/src/cache/resources/presence.ts index feee1a7..d5afdca 100644 --- a/src/cache/resources/presence.ts +++ b/src/cache/resources/presence.ts @@ -1,4 +1,4 @@ -import type { GatewayPresenceUpdate } from '../../common'; +import type { GatewayPresenceUpdate } from 'discord-api-types/v10'; import { GuildRelatedResource } from './default/guild-related'; export class Presences extends GuildRelatedResource { diff --git a/src/cache/resources/stage-instances.ts b/src/cache/resources/stage-instances.ts index 92e8726..ff49fdf 100644 --- a/src/cache/resources/stage-instances.ts +++ b/src/cache/resources/stage-instances.ts @@ -1,4 +1,4 @@ -import type { APIStageInstance } from '../../common'; +import type { APIStageInstance } from 'discord-api-types/v10'; import { GuildRelatedResource } from './default/guild-related'; export class StageInstances extends GuildRelatedResource { diff --git a/src/cache/resources/stickers.ts b/src/cache/resources/stickers.ts index b87a7e8..c9b617e 100644 --- a/src/cache/resources/stickers.ts +++ b/src/cache/resources/stickers.ts @@ -1,5 +1,6 @@ +import type { APISticker } from 'discord-api-types/v10'; import type { ReturnCache } from '../..'; -import { fakePromise, type APISticker } from '../../common'; +import { fakePromise } from '../../common'; import { Sticker } from '../../structures'; import { GuildRelatedResource } from './default/guild-related'; diff --git a/src/cache/resources/threads.ts b/src/cache/resources/threads.ts index f49555c..16cb420 100644 --- a/src/cache/resources/threads.ts +++ b/src/cache/resources/threads.ts @@ -1,5 +1,6 @@ +import type { APIThreadChannel } from 'discord-api-types/v10'; import type { ReturnCache } from '../..'; -import { fakePromise, type APIThreadChannel } from '../../common'; +import { fakePromise } from '../../common'; import { ThreadChannel } from '../../structures'; import { GuildRelatedResource } from './default/guild-related'; diff --git a/src/cache/resources/users.ts b/src/cache/resources/users.ts index 55d9f2a..8af94a0 100644 --- a/src/cache/resources/users.ts +++ b/src/cache/resources/users.ts @@ -1,5 +1,6 @@ +import type { APIUser } from 'discord-api-types/v10'; import type { ReturnCache } from '../..'; -import { fakePromise, type APIUser } from '../../common'; +import { fakePromise } from '../../common'; import { User } from '../../structures'; import { BaseResource } from './default/base'; diff --git a/src/client/base.ts b/src/client/base.ts index 6791dfb..997e990 100644 --- a/src/client/base.ts +++ b/src/client/base.ts @@ -20,10 +20,10 @@ import { WebhookShorter, filterSplit, magicImport, - type LocaleString, type MakeRequired, } from '../common'; +import type { LocaleString } from 'discord-api-types/rest/v10'; import type { DeepPartial, IntentStrings, OmitInsert, When } from '../common/types/util'; import type { ComponentCommand, ModalCommand } from '../components'; import { ComponentHandler, type ComponentHandlerLike } from '../components/handler'; diff --git a/src/client/client.ts b/src/client/client.ts index bc02346..4345af4 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -1,14 +1,7 @@ +import { type GatewayDispatchPayload, GatewayIntentBits, type GatewayPresenceUpdateData } from 'discord-api-types/v10'; import { parentPort, workerData } from 'node:worker_threads'; import type { ClientEvent, Command, CommandContext, EventHandlerLike, Message, SubCommand } from '..'; -import { - GatewayIntentBits, - type DeepPartial, - type GatewayDispatchPayload, - type GatewayPresenceUpdateData, - type If, - type WatcherPayload, - type WatcherSendToShard, -} from '../common'; +import type { DeepPartial, If, WatcherPayload, WatcherSendToShard } from '../common'; import { EventHandler } from '../events'; import { ClientUser } from '../structures'; import { ShardManager, properties, type ShardManagerOptions } from '../websocket'; diff --git a/src/client/httpclient.ts b/src/client/httpclient.ts index 919f65d..f97f1b7 100644 --- a/src/client/httpclient.ts +++ b/src/client/httpclient.ts @@ -1,9 +1,9 @@ +import { type APIInteraction, InteractionResponseType, InteractionType } from 'discord-api-types/v10'; import { filetypeinfo } from 'magic-bytes.js'; import type { HttpRequest, HttpResponse } from 'uWebSockets.js'; import { OverwrittenMimeTypes } from '../api'; import { isBufferLike } from '../api/utils/utils'; -import type { APIInteraction, DeepPartial } from '../common'; -import { InteractionResponseType, InteractionType } from '../common'; +import type { DeepPartial } from '../common'; import type { BaseClientOptions, InternalRuntimeConfigHTTP, StartOptions } from './base'; import { BaseClient } from './base'; import { onInteractionCreate } from './oninteractioncreate'; diff --git a/src/client/workerclient.ts b/src/client/workerclient.ts index 93d4ef1..48e4d0f 100644 --- a/src/client/workerclient.ts +++ b/src/client/workerclient.ts @@ -1,10 +1,10 @@ +import { type GatewayDispatchPayload, GatewayIntentBits, type GatewaySendPayload } from 'discord-api-types/v10'; import { randomUUID } from 'node:crypto'; import { parentPort as manager } from 'node:worker_threads'; -import { ApiHandler } from '..'; +import { ApiHandler, Logger } from '..'; import type { Cache } from '../cache'; import { WorkerAdapter } from '../cache'; -import type { GatewayDispatchPayload, GatewaySendPayload, When } from '../common'; -import { GatewayIntentBits, LogLevels, Logger, type DeepPartial } from '../common'; +import { type DeepPartial, LogLevels, type When } from '../common'; import { EventHandler, type EventHandlerLike } from '../events'; import { ClientUser } from '../structures'; import { Shard, type ShardManagerOptions, type WorkerData } from '../websocket'; diff --git a/src/commands/applications/chat.ts b/src/commands/applications/chat.ts index ede6928..49b333e 100644 --- a/src/commands/applications/chat.ts +++ b/src/commands/applications/chat.ts @@ -1,14 +1,14 @@ -import type { SeyfertNumberOption, SeyfertStringOption } from '../..'; +import { + type APIApplicationCommandBasicOption, + type APIApplicationCommandOption, + type APIApplicationCommandSubcommandGroupOption, + ApplicationCommandOptionType, + ApplicationCommandType, + type LocaleString, +} from 'discord-api-types/v10'; +import type { PermissionStrings, SeyfertNumberOption, SeyfertStringOption } from '../..'; import type { Attachment } from '../../builders'; -import type { - APIApplicationCommandBasicOption, - APIApplicationCommandOption, - APIApplicationCommandSubcommandGroupOption, - FlatObjectKeys, - LocaleString, - PermissionStrings, -} from '../../common'; -import { ApplicationCommandOptionType, ApplicationCommandType, magicImport } from '../../common'; +import { type FlatObjectKeys, magicImport } from '../../common'; import type { AllChannels, AutocompleteInteraction, GuildRole, InteractionGuildMember, User } from '../../structures'; import type { Groups, IntegrationTypes, InteractionContextTypes, RegisteredMiddlewares } from '../decorators'; import type { OptionResolver } from '../optionresolver'; diff --git a/src/commands/applications/chatcontext.ts b/src/commands/applications/chatcontext.ts index 0d0f2da..45e888c 100644 --- a/src/commands/applications/chatcontext.ts +++ b/src/commands/applications/chatcontext.ts @@ -1,6 +1,7 @@ +import { MessageFlags } from 'discord-api-types/v10'; import type { AllChannels, Guild, InferWithPrefix, ReturnCache, WebhookMessage } from '../..'; import type { Client, WorkerClient } from '../../client'; -import { MessageFlags, type If, type UnionToTuple, type When } from '../../common'; +import type { If, UnionToTuple, When } from '../../common'; import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest } from '../../common/types/write'; import { Message, diff --git a/src/commands/applications/menu.ts b/src/commands/applications/menu.ts index 99d9c53..d4cc165 100644 --- a/src/commands/applications/menu.ts +++ b/src/commands/applications/menu.ts @@ -1,4 +1,5 @@ -import { magicImport, type ApplicationCommandType, type LocaleString, type PermissionStrings } from '../../common'; +import type { ApplicationCommandType, LocaleString } from 'discord-api-types/v10'; +import { type PermissionStrings, magicImport } from '../../common'; import type { IntegrationTypes, InteractionContextTypes, RegisteredMiddlewares } from '../decorators'; import type { MenuCommandContext } from './menucontext'; import type { PassFunction, StopFunction, UsingClient } from './shared'; diff --git a/src/commands/applications/menucontext.ts b/src/commands/applications/menucontext.ts index 4a00fc6..7429c3f 100644 --- a/src/commands/applications/menucontext.ts +++ b/src/commands/applications/menucontext.ts @@ -1,7 +1,6 @@ +import { ApplicationCommandType, MessageFlags } from 'discord-api-types/v10'; import type { ContextMenuCommand, ReturnCache, WebhookMessage } from '../..'; import { - ApplicationCommandType, - MessageFlags, toSnakeCase, type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, diff --git a/src/commands/decorators.ts b/src/commands/decorators.ts index a30ccf4..55effd1 100644 --- a/src/commands/decorators.ts +++ b/src/commands/decorators.ts @@ -1,10 +1,5 @@ -import { - ApplicationCommandType, - PermissionFlagsBits, - type FlatObjectKeys, - type LocaleString, - type PermissionStrings, -} from '../common'; +import { ApplicationCommandType, type LocaleString, PermissionFlagsBits } from 'discord-api-types/v10'; +import type { FlatObjectKeys, PermissionStrings } from '../common'; import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat'; import type { DefaultLocale, MiddlewareContext } from './applications/shared'; diff --git a/src/commands/handler.ts b/src/commands/handler.ts index ee1c1df..2365666 100644 --- a/src/commands/handler.ts +++ b/src/commands/handler.ts @@ -1,6 +1,7 @@ +import { Locale, type LocaleString } from 'discord-api-types/v10'; import { basename, dirname } from 'node:path'; import type { Logger } from '../common'; -import { BaseHandler, Locale, type LocaleString } from '../common'; +import { BaseHandler } from '../common'; import { Command, SubCommand } from './applications/chat'; import { ContextMenuCommand } from './applications/menu'; import type { UsingClient } from './applications/shared'; diff --git a/src/commands/optionresolver.ts b/src/commands/optionresolver.ts index 57f7f5f..b2fcc00 100644 --- a/src/commands/optionresolver.ts +++ b/src/commands/optionresolver.ts @@ -1,15 +1,15 @@ +import { + type APIApplicationCommandInteractionDataOption, + type APIAttachment, + type APIGuildMember, + type APIInteractionDataResolvedChannel, + type APIInteractionGuildMember, + type APIRole, + type APIUser, + ApplicationCommandOptionType, +} from 'discord-api-types/v10'; import { Attachment, GuildMember } from '..'; -import type { - APIApplicationCommandInteractionDataOption, - APIAttachment, - APIGuildMember, - APIInteractionDataResolvedChannel, - APIInteractionGuildMember, - APIRole, - APIUser, - MakeRequired, -} from '../common'; -import { ApplicationCommandOptionType } from '../common'; +import type { MakeRequired } from '../common'; import type { AllChannels } from '../structures'; import { GuildRole, InteractionGuildMember, User } from '../structures'; import channelFrom from '../structures/channels'; diff --git a/src/common/index.ts b/src/common/index.ts index d064cf0..6d1e0bc 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -1,7 +1,6 @@ export * from './it/constants'; export * from './it/utils'; // -export * from 'discord-api-types/v10'; export * from './it/colors'; export * from './it/logger'; export * from './shorters/channels'; diff --git a/src/common/shorters/channels.ts b/src/common/shorters/channels.ts index 2f8c56f..d4a644a 100644 --- a/src/common/shorters/channels.ts +++ b/src/common/shorters/channels.ts @@ -1,4 +1,4 @@ -import { PermissionFlagsBits, type RESTPatchAPIChannelJSONBody } from '..'; +import { PermissionFlagsBits, type RESTPatchAPIChannelJSONBody } from 'discord-api-types/v10'; import { BaseChannel, Message, type GuildMember, type GuildRole } from '../../structures'; import channelFrom, { type AllChannels } from '../../structures/channels'; import { PermissionsBitField } from '../../structures/extra/Permissions'; diff --git a/src/common/shorters/members.ts b/src/common/shorters/members.ts index d84b68a..25a1b88 100644 --- a/src/common/shorters/members.ts +++ b/src/common/shorters/members.ts @@ -1,15 +1,15 @@ -import { - FormattingPatterns, - type APIGuildMember, - type GuildMemberResolvable, - type RESTGetAPIGuildMembersQuery, - type RESTGetAPIGuildMembersSearchQuery, - type RESTPatchAPIGuildMemberJSONBody, - type RESTPutAPIGuildBanJSONBody, - type RESTPutAPIGuildMemberJSONBody, -} from '..'; +import { FormattingPatterns } from 'discord-api-types/globals'; +import type { + APIGuildMember, + RESTGetAPIGuildMembersQuery, + RESTGetAPIGuildMembersSearchQuery, + RESTPatchAPIGuildMemberJSONBody, + RESTPutAPIGuildBanJSONBody, + RESTPutAPIGuildMemberJSONBody, +} from 'discord-api-types/v10'; import { GuildMember } from '../../structures'; import { PermissionsBitField } from '../../structures/extra/Permissions'; +import type { GuildMemberResolvable } from '../types/resolvables'; import { BaseShorter } from './base'; export class MemberShorter extends BaseShorter { diff --git a/src/common/shorters/webhook.ts b/src/common/shorters/webhook.ts index 8b5aa25..44c19ba 100644 --- a/src/common/shorters/webhook.ts +++ b/src/common/shorters/webhook.ts @@ -3,7 +3,7 @@ import type { RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, -} from '..'; +} from 'discord-api-types/v10'; import { resolveFiles } from '../../builders'; import { MessagesMethods, diff --git a/src/common/types/resolvables.ts b/src/common/types/resolvables.ts index cb3370d..4f24d02 100644 --- a/src/common/types/resolvables.ts +++ b/src/common/types/resolvables.ts @@ -1,4 +1,5 @@ -import type { APIPartialEmoji, EmbedColors } from '..'; +import type { APIPartialEmoji } from 'discord-api-types/v10'; +import type { EmbedColors } from '..'; import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders'; import type { GuildMember } from '../../structures'; diff --git a/src/common/types/util.ts b/src/common/types/util.ts index 59de584..786c8e0 100644 --- a/src/common/types/util.ts +++ b/src/common/types/util.ts @@ -1,4 +1,4 @@ -import type { GatewayIntentBits, PermissionFlagsBits } from '..'; +import type { GatewayIntentBits, PermissionFlagsBits } from 'discord-api-types/v10'; export type ToClass = new ( ...args: any[] diff --git a/src/common/types/write.ts b/src/common/types/write.ts index 6e9ab16..5310164 100644 --- a/src/common/types/write.ts +++ b/src/common/types/write.ts @@ -9,7 +9,7 @@ import type { RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIWebhookWithTokenJSONBody, -} from '..'; +} from 'discord-api-types/v10'; import type { RawFile } from '../../api'; import type { ActionRow, Attachment, AttachmentBuilder, BuilderComponents, Embed, Modal } from '../../builders'; diff --git a/src/components/ActionRow.ts b/src/components/ActionRow.ts index 3c3e8cf..8b2c930 100644 --- a/src/components/ActionRow.ts +++ b/src/components/ActionRow.ts @@ -1,4 +1,4 @@ -import type { APIMessageActionRowComponent, ComponentType } from '../common'; +import type { APIMessageActionRowComponent, ComponentType } from 'discord-api-types/v10'; import { BaseComponent } from './BaseComponent'; import type { ActionRowMessageComponents } from './index'; import { componentFactory } from './index'; diff --git a/src/components/BaseComponent.ts b/src/components/BaseComponent.ts index 563f508..a39db17 100644 --- a/src/components/BaseComponent.ts +++ b/src/components/BaseComponent.ts @@ -1,16 +1,16 @@ -import { fromComponent } from '../builders'; -import type { - APIActionRowComponent, - APIActionRowComponentTypes, - APIButtonComponent, - APIChannelSelectComponent, - APIMentionableSelectComponent, - APIRoleSelectComponent, - APIStringSelectComponent, - APITextInputComponent, - APIUserSelectComponent, +import { + type APIActionRowComponent, + type APIActionRowComponentTypes, + type APIButtonComponent, + type APIChannelSelectComponent, + type APIMentionableSelectComponent, + type APIRoleSelectComponent, + type APIStringSelectComponent, + type APITextInputComponent, + type APIUserSelectComponent, ComponentType, -} from '../common'; +} from 'discord-api-types/v10'; +import { fromComponent } from '../builders'; export class BaseComponent { constructor(public data: APIComponentsMap[T]) {} diff --git a/src/components/BaseSelectMenuComponent.ts b/src/components/BaseSelectMenuComponent.ts index 223b7ad..2c776b6 100644 --- a/src/components/BaseSelectMenuComponent.ts +++ b/src/components/BaseSelectMenuComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseComponent } from './BaseComponent'; export type APISelectMenuComponentTypes = diff --git a/src/components/ButtonComponent.ts b/src/components/ButtonComponent.ts index c131f12..8f592bb 100644 --- a/src/components/ButtonComponent.ts +++ b/src/components/ButtonComponent.ts @@ -1,5 +1,5 @@ +import type { ButtonStyle, ComponentType } from 'discord-api-types/v10'; import { Button, type ButtonStylesForID } from '../builders'; -import type { ButtonStyle, ComponentType } from '../common'; import { BaseComponent } from './BaseComponent'; export class LinkButtonComponent extends BaseComponent { diff --git a/src/components/ChannelSelectMenuComponent.ts b/src/components/ChannelSelectMenuComponent.ts index 60797c0..2b53cc2 100644 --- a/src/components/ChannelSelectMenuComponent.ts +++ b/src/components/ChannelSelectMenuComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; export class ChannelSelectMenuComponent extends BaseSelectMenuComponent { diff --git a/src/components/MentionableSelectMenuComponent.ts b/src/components/MentionableSelectMenuComponent.ts index 2f513f2..56773f8 100644 --- a/src/components/MentionableSelectMenuComponent.ts +++ b/src/components/MentionableSelectMenuComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; export class MentionableSelectMenuComponent extends BaseSelectMenuComponent { diff --git a/src/components/RoleSelectMenuComponent.ts b/src/components/RoleSelectMenuComponent.ts index 0f257c7..5a3e94e 100644 --- a/src/components/RoleSelectMenuComponent.ts +++ b/src/components/RoleSelectMenuComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; export class RoleSelectMenuComponent extends BaseSelectMenuComponent { diff --git a/src/components/StringSelectMenuComponent.ts b/src/components/StringSelectMenuComponent.ts index 6ed8071..90dc2e9 100644 --- a/src/components/StringSelectMenuComponent.ts +++ b/src/components/StringSelectMenuComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; export class StringSelectMenuComponent extends BaseSelectMenuComponent { diff --git a/src/components/TextInputComponent.ts b/src/components/TextInputComponent.ts index 87ec198..485382e 100644 --- a/src/components/TextInputComponent.ts +++ b/src/components/TextInputComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseComponent } from './BaseComponent'; export class TextInputComponent extends BaseComponent { diff --git a/src/components/UserSelectMenuComponent.ts b/src/components/UserSelectMenuComponent.ts index 4aa7ce5..98f9183 100644 --- a/src/components/UserSelectMenuComponent.ts +++ b/src/components/UserSelectMenuComponent.ts @@ -1,4 +1,4 @@ -import type { ComponentType } from '../common'; +import type { ComponentType } from 'discord-api-types/v10'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; export class UserSelectMenuComponent extends BaseSelectMenuComponent { diff --git a/src/components/index.ts b/src/components/index.ts index f6958e3..411cd41 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,4 @@ -import type { APIMessageActionRowComponent } from '../common'; -import { ButtonStyle, ComponentType } from '../common'; +import { type APIMessageActionRowComponent, ButtonStyle, ComponentType } from 'discord-api-types/v10'; import { BaseComponent } from './BaseComponent'; import { ButtonComponent, LinkButtonComponent } from './ButtonComponent'; import { ChannelSelectMenuComponent } from './ChannelSelectMenuComponent'; diff --git a/src/events/handler.ts b/src/events/handler.ts index fbde850..784be99 100644 --- a/src/events/handler.ts +++ b/src/events/handler.ts @@ -1,12 +1,14 @@ +import type { + GatewayDispatchPayload, + GatewayMessageCreateDispatch, + GatewayMessageDeleteBulkDispatch, + GatewayMessageDeleteDispatch, +} from 'discord-api-types/v10'; import type { Client, WorkerClient } from '../client'; import { BaseHandler, ReplaceRegex, magicImport, - type GatewayDispatchPayload, - type GatewayMessageCreateDispatch, - type GatewayMessageDeleteBulkDispatch, - type GatewayMessageDeleteDispatch, type MakeRequired, type OnFailCallback, type SnakeCase, diff --git a/src/events/hooks/application_command.ts b/src/events/hooks/application_command.ts index 3bbf056..814cbad 100644 --- a/src/events/hooks/application_command.ts +++ b/src/events/hooks/application_command.ts @@ -1,5 +1,5 @@ +import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../common'; import { toCamelCase } from '../../common'; export const APPLICATION_COMMAND_PERMISSIONS_UPDATE = ( diff --git a/src/events/hooks/auto_moderation.ts b/src/events/hooks/auto_moderation.ts index 21e129d..fba7fe3 100644 --- a/src/events/hooks/auto_moderation.ts +++ b/src/events/hooks/auto_moderation.ts @@ -1,11 +1,11 @@ +import type { + GatewayAutoModerationActionExecutionDispatchData, + GatewayAutoModerationRuleCreateDispatchData, + GatewayAutoModerationRuleDeleteDispatchData, + GatewayAutoModerationRuleUpdateDispatchData, +} from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import { - type GatewayAutoModerationActionExecutionDispatchData, - type GatewayAutoModerationRuleCreateDispatchData, - type GatewayAutoModerationRuleDeleteDispatchData, - type GatewayAutoModerationRuleUpdateDispatchData, - toCamelCase, -} from '../../common'; +import { toCamelCase } from '../../common'; import { AutoModerationRule } from '../../structures'; export const AUTO_MODERATION_ACTION_EXECUTION = ( diff --git a/src/events/hooks/channel.ts b/src/events/hooks/channel.ts index 8bdb2a3..8771c2b 100644 --- a/src/events/hooks/channel.ts +++ b/src/events/hooks/channel.ts @@ -1,12 +1,12 @@ -import { - toCamelCase, - type GatewayChannelCreateDispatchData, - type GatewayChannelDeleteDispatchData, - type GatewayChannelPinsUpdateDispatchData, - type GatewayChannelUpdateDispatchData, -} from '../../common'; +import type { + GatewayChannelCreateDispatchData, + GatewayChannelDeleteDispatchData, + GatewayChannelPinsUpdateDispatchData, + GatewayChannelUpdateDispatchData, +} from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; +import { toCamelCase } from '../../common'; import type { AllChannels } from '../../structures'; import channelFrom from '../../structures/channels'; diff --git a/src/events/hooks/dispatch.ts b/src/events/hooks/dispatch.ts index bb0faec..d58fb89 100644 --- a/src/events/hooks/dispatch.ts +++ b/src/events/hooks/dispatch.ts @@ -1,5 +1,5 @@ +import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from '../../common'; import { ClientUser } from '../../structures'; export const READY = (self: BaseClient, data: GatewayReadyDispatchData) => { diff --git a/src/events/hooks/entitlement.ts b/src/events/hooks/entitlement.ts index a11300b..d5176ce 100644 --- a/src/events/hooks/entitlement.ts +++ b/src/events/hooks/entitlement.ts @@ -1,5 +1,6 @@ +import type { APIEntitlement } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import { type APIEntitlement, toCamelCase } from '../../common'; +import { toCamelCase } from '../../common'; export const ENTITLEMENT_CREATE = (_: BaseClient, data: APIEntitlement) => { return toCamelCase(data); diff --git a/src/events/hooks/guild.ts b/src/events/hooks/guild.ts index 4f98ea1..ed64669 100644 --- a/src/events/hooks/guild.ts +++ b/src/events/hooks/guild.ts @@ -1,4 +1,3 @@ -import type { BaseClient } from '../../client/base'; import type { GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, @@ -20,7 +19,8 @@ import type { GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, -} from '../../common'; +} from 'discord-api-types/v10'; +import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; import { Guild, diff --git a/src/events/hooks/integration.ts b/src/events/hooks/integration.ts index 2246c09..e273dea 100644 --- a/src/events/hooks/integration.ts +++ b/src/events/hooks/integration.ts @@ -1,9 +1,9 @@ -import type { BaseClient } from '../../client/base'; import type { GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, -} from '../../common'; +} from 'discord-api-types/v10'; +import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; import { User } from '../../structures'; diff --git a/src/events/hooks/interactions.ts b/src/events/hooks/interactions.ts index 81f5945..75b1212 100644 --- a/src/events/hooks/interactions.ts +++ b/src/events/hooks/interactions.ts @@ -1,5 +1,5 @@ +import type { GatewayInteractionCreateDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import type { GatewayInteractionCreateDispatchData } from '../../common'; import { BaseInteraction } from '../../structures'; export const INTERACTION_CREATE = (self: BaseClient, data: GatewayInteractionCreateDispatchData) => { diff --git a/src/events/hooks/invite.ts b/src/events/hooks/invite.ts index dc7e7a5..f6c4209 100644 --- a/src/events/hooks/invite.ts +++ b/src/events/hooks/invite.ts @@ -1,4 +1,4 @@ -import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from '../../common'; +import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; diff --git a/src/events/hooks/message.ts b/src/events/hooks/message.ts index fd66f59..732272e 100644 --- a/src/events/hooks/message.ts +++ b/src/events/hooks/message.ts @@ -1,4 +1,3 @@ -import type { BaseClient } from '../../client/base'; import type { APIMessage, GatewayMessageCreateDispatchData, @@ -9,10 +8,9 @@ import type { GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, - MakeRequired, - PartialClass, -} from '../../common'; -import { toCamelCase } from '../../common'; +} from 'discord-api-types/v10'; +import type { BaseClient } from '../../client/base'; +import { type MakeRequired, type PartialClass, toCamelCase } from '../../common'; import { Message } from '../../structures'; export const MESSAGE_CREATE = (self: BaseClient, data: GatewayMessageCreateDispatchData) => { diff --git a/src/events/hooks/presence.ts b/src/events/hooks/presence.ts index 6c569eb..07e9507 100644 --- a/src/events/hooks/presence.ts +++ b/src/events/hooks/presence.ts @@ -1,4 +1,4 @@ -import type { GatewayPresenceUpdateDispatchData } from '../../common'; +import type { GatewayPresenceUpdateDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; diff --git a/src/events/hooks/stage.ts b/src/events/hooks/stage.ts index f87ce48..2ac9c29 100644 --- a/src/events/hooks/stage.ts +++ b/src/events/hooks/stage.ts @@ -1,4 +1,7 @@ -import type { GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData } from '../../common'; +import type { + GatewayStageInstanceCreateDispatchData, + GatewayStageInstanceDeleteDispatchData, +} from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; diff --git a/src/events/hooks/thread.ts b/src/events/hooks/thread.ts index 80f511c..ca27d14 100644 --- a/src/events/hooks/thread.ts +++ b/src/events/hooks/thread.ts @@ -1,4 +1,3 @@ -import type { BaseClient } from '../../client/base'; import type { GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, @@ -6,7 +5,8 @@ import type { GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, -} from '../../common'; +} from 'discord-api-types/v10'; +import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; import { ThreadChannel } from '../../structures'; diff --git a/src/events/hooks/typing.ts b/src/events/hooks/typing.ts index 54d8340..af33789 100644 --- a/src/events/hooks/typing.ts +++ b/src/events/hooks/typing.ts @@ -1,4 +1,4 @@ -import type { GatewayTypingStartDispatchData } from '../../common'; +import type { GatewayTypingStartDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; import { toCamelCase } from '../../common'; diff --git a/src/events/hooks/user.ts b/src/events/hooks/user.ts index 598cd10..5f1b22e 100644 --- a/src/events/hooks/user.ts +++ b/src/events/hooks/user.ts @@ -1,5 +1,5 @@ +import type { GatewayUserUpdateDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import type { GatewayUserUpdateDispatchData } from '../../common'; import { User } from '../../structures'; export const USER_UPDATE = (self: BaseClient, data: GatewayUserUpdateDispatchData) => { diff --git a/src/events/hooks/voice.ts b/src/events/hooks/voice.ts index ebb8d39..a1d6edc 100644 --- a/src/events/hooks/voice.ts +++ b/src/events/hooks/voice.ts @@ -1,5 +1,5 @@ +import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from '../../common'; import { toCamelCase } from '../../common'; import { GuildMember } from '../../structures'; diff --git a/src/events/hooks/webhook.ts b/src/events/hooks/webhook.ts index 6e5d009..c475d3b 100644 --- a/src/events/hooks/webhook.ts +++ b/src/events/hooks/webhook.ts @@ -1,5 +1,5 @@ +import type { GatewayWebhooksUpdateDispatchData } from 'discord-api-types/v10'; import type { BaseClient } from '../../client/base'; -import type { GatewayWebhooksUpdateDispatchData } from '../../common'; import { toCamelCase } from '../../common'; export const WEBHOOKS_UPDATE = (_self: BaseClient, data: GatewayWebhooksUpdateDispatchData) => { diff --git a/src/index.ts b/src/index.ts index 0aa86b5..15e08c7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import { GatewayIntentBits } from 'discord-api-types/gateway/v10'; import type { BaseClientOptions, InternalRuntimeConfig, @@ -5,10 +6,8 @@ import type { RuntimeConfig, RuntimeConfigHTTP, } from './client/base'; -import { GatewayIntentBits } from './common'; import type { ClientNameEvents, EventContext } from './events'; - -export { Logger, PermissionFlagsBits, PermissionStrings, Watcher } from './common'; +export { Logger, PermissionStrings, Watcher } from './common'; // export { Collection, LimitedCollection } from './collection'; // diff --git a/src/langs/handler.ts b/src/langs/handler.ts index aba1432..ef5b78a 100644 --- a/src/langs/handler.ts +++ b/src/langs/handler.ts @@ -1,4 +1,5 @@ -import { BaseHandler, type Locale, type LocaleString } from '../common'; +import type { Locale, LocaleString } from 'discord-api-types/v10'; +import { BaseHandler } from '../common'; import { LangRouter } from './router'; export interface LangsHandlerLike { diff --git a/src/structures/AutoModerationRule.ts b/src/structures/AutoModerationRule.ts index a858c81..46e6a8e 100644 --- a/src/structures/AutoModerationRule.ts +++ b/src/structures/AutoModerationRule.ts @@ -1,11 +1,10 @@ -import type { UsingClient } from '../commands'; import type { APIAutoModerationRule, - MethodContext, - ObjectToLower, RESTPatchAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleJSONBody, -} from '../common'; +} from 'discord-api-types/v10'; +import type { UsingClient } from '../commands'; +import type { MethodContext, ObjectToLower } from '../common'; import { DiscordBase } from './extra/DiscordBase'; export interface AutoModerationRule extends ObjectToLower {} diff --git a/src/structures/ClientUser.ts b/src/structures/ClientUser.ts index 5b5e9aa..d1f05cf 100644 --- a/src/structures/ClientUser.ts +++ b/src/structures/ClientUser.ts @@ -1,5 +1,5 @@ +import type { GatewayReadyDispatchData, RESTPatchAPICurrentUserJSONBody } from 'discord-api-types/v10'; import type { UsingClient } from '../commands'; -import type { GatewayReadyDispatchData, RESTPatchAPICurrentUserJSONBody } from '../common'; import { User } from './User'; export class ClientUser extends User { diff --git a/src/structures/Guild.ts b/src/structures/Guild.ts index 2f7ff01..0b707a9 100644 --- a/src/structures/Guild.ts +++ b/src/structures/Guild.ts @@ -1,6 +1,6 @@ +import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData } from 'discord-api-types/v10'; import type { UsingClient } from '../commands'; -import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, ObjectToLower } from '../common'; -import type { StructPropState, StructStates, ToClass } from '../common/types/util'; +import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util'; import { AutoModerationRule } from './AutoModerationRule'; import { GuildEmoji } from './GuildEmoji'; import { GuildMember } from './GuildMember'; diff --git a/src/structures/GuildEmoji.ts b/src/structures/GuildEmoji.ts index e99cea3..4024a79 100644 --- a/src/structures/GuildEmoji.ts +++ b/src/structures/GuildEmoji.ts @@ -1,13 +1,7 @@ +import type { APIEmoji, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildEmojiJSONBody } from 'discord-api-types/v10'; import type { BaseImageURLOptions } from '../api'; import type { UsingClient } from '../commands'; -import type { - APIEmoji, - EmojiShorter, - MethodContext, - ObjectToLower, - RESTPatchAPIChannelJSONBody, - RESTPatchAPIGuildEmojiJSONBody, -} from '../common'; +import type { EmojiShorter, MethodContext, ObjectToLower } from '../common'; import { DiscordBase } from './extra/DiscordBase'; export interface GuildEmoji extends DiscordBase, ObjectToLower> {} diff --git a/src/structures/GuildMember.ts b/src/structures/GuildMember.ts index d7ceba6..b5ddbf4 100644 --- a/src/structures/GuildMember.ts +++ b/src/structures/GuildMember.ts @@ -1,19 +1,3 @@ -import type { - APIGuildMember, - APIInteractionDataResolvedGuildMember, - APIUser, - GatewayGuildMemberAddDispatchData, - GatewayGuildMemberUpdateDispatchData, - MakeRequired, - MessageCreateBodyRequest, - ObjectToLower, - RESTGetAPIGuildMembersQuery, - RESTGetAPIGuildMembersSearchQuery, - RESTPatchAPIGuildMemberJSONBody, - RESTPutAPIGuildBanJSONBody, - RESTPutAPIGuildMemberJSONBody, - ToClass, -} from '../common'; import { DiscordBase } from './extra/DiscordBase'; export type GuildMemberData = @@ -22,7 +6,20 @@ export type GuildMemberData = | GatewayGuildMemberAddDispatchData | APIInteractionDataResolvedGuildMember; +import type { + APIGuildMember, + APIInteractionDataResolvedGuildMember, + APIUser, + GatewayGuildMemberAddDispatchData, + GatewayGuildMemberUpdateDispatchData, + RESTGetAPIGuildMembersQuery, + RESTGetAPIGuildMembersSearchQuery, + RESTPatchAPIGuildMemberJSONBody, + RESTPutAPIGuildBanJSONBody, + RESTPutAPIGuildMemberJSONBody, +} from 'discord-api-types/v10'; import type { UsingClient } from '../commands'; +import type { MakeRequired, MessageCreateBodyRequest, ObjectToLower, ToClass } from '../common'; import type { ImageOptions, MethodContext } from '../common/types/options'; import type { GuildMemberResolvable } from '../common/types/resolvables'; import { User } from './User'; diff --git a/src/structures/GuildPreview.ts b/src/structures/GuildPreview.ts index bc53553..6805649 100644 --- a/src/structures/GuildPreview.ts +++ b/src/structures/GuildPreview.ts @@ -1,5 +1,5 @@ +import type { APIGuildPreview, APIPartialGuild } from 'discord-api-types/v10'; import type { UsingClient } from '../commands'; -import type { APIGuildPreview, APIPartialGuild } from '../common'; import { AnonymousGuild } from './AnonymousGuild'; /** diff --git a/src/structures/GuildRole.ts b/src/structures/GuildRole.ts index 718c244..4a1b27a 100644 --- a/src/structures/GuildRole.ts +++ b/src/structures/GuildRole.ts @@ -1,12 +1,11 @@ -import type { UsingClient } from '../commands'; import type { APIRole, - MethodContext, - ObjectToLower, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPostAPIGuildRoleJSONBody, -} from '../common'; +} from 'discord-api-types/v10'; +import type { UsingClient } from '../commands'; +import type { MethodContext, 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 31f074e..165b83a 100644 --- a/src/structures/GuildTemplate.ts +++ b/src/structures/GuildTemplate.ts @@ -1,11 +1,10 @@ -import type { UsingClient } from '../commands'; import type { APITemplate, - MethodContext, - ObjectToLower, RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody, -} from '../common'; +} from 'discord-api-types/v10'; +import type { UsingClient } from '../commands'; +import type { MethodContext, ObjectToLower } from '../common'; import { Base } from './extra/Base'; export interface GuildTemplate extends Base, ObjectToLower {} diff --git a/src/structures/Interaction.ts b/src/structures/Interaction.ts index 3b84c06..9b1d82c 100644 --- a/src/structures/Interaction.ts +++ b/src/structures/Interaction.ts @@ -1,46 +1,46 @@ +import { + type APIActionRowComponent, + type APIApplicationCommandAutocompleteInteraction, + type APIApplicationCommandInteraction, + type APIBaseInteraction, + type APIChatInputApplicationCommandInteraction, + type APIChatInputApplicationCommandInteractionData, + type APICommandAutocompleteInteractionResponseCallbackData, + type APIInteraction, + type APIInteractionResponse, + type APIInteractionResponseChannelMessageWithSource, + type APIInteractionResponseDeferredChannelMessageWithSource, + type APIInteractionResponseDeferredMessageUpdate, + type APIInteractionResponsePong, + type APIInteractionResponseUpdateMessage, + type APIMessageApplicationCommandInteraction, + type APIMessageApplicationCommandInteractionData, + type APIMessageButtonInteractionData, + type APIMessageChannelSelectInteractionData, + type APIMessageComponentInteraction, + type APIMessageComponentSelectMenuInteraction, + type APIMessageMentionableSelectInteractionData, + type APIMessageRoleSelectInteractionData, + type APIMessageStringSelectInteractionData, + type APIMessageUserSelectInteractionData, + type APIModalSubmission, + type APIModalSubmitInteraction, + type APITextInputComponent, + type APIUserApplicationCommandInteraction, + type APIUserApplicationCommandInteractionData, + ApplicationCommandType, + ComponentType, + type GatewayInteractionCreateDispatchData, + InteractionResponseType, + InteractionType, + type MessageFlags, + type RESTPostAPIInteractionCallbackJSONBody, +} from 'discord-api-types/v10'; import { mix } from 'ts-mixer'; import type { RawFile } from '../api'; import { ActionRow, Embed, Modal, resolveAttachment, resolveFiles } from '../builders'; import { OptionResolver, type ContextOptionsResolved, type UsingClient } from '../commands'; -import type { - APIActionRowComponent, - APIApplicationCommandAutocompleteInteraction, - APIApplicationCommandInteraction, - APIBaseInteraction, - APIChatInputApplicationCommandInteraction, - APIChatInputApplicationCommandInteractionData, - APICommandAutocompleteInteractionResponseCallbackData, - APIInteraction, - APIInteractionResponse, - APIInteractionResponseChannelMessageWithSource, - APIInteractionResponseDeferredChannelMessageWithSource, - APIInteractionResponseDeferredMessageUpdate, - APIInteractionResponsePong, - APIInteractionResponseUpdateMessage, - APIMessageApplicationCommandInteraction, - APIMessageApplicationCommandInteractionData, - APIMessageButtonInteractionData, - APIMessageChannelSelectInteractionData, - APIMessageComponentInteraction, - APIMessageComponentSelectMenuInteraction, - APIMessageMentionableSelectInteractionData, - APIMessageRoleSelectInteractionData, - APIMessageStringSelectInteractionData, - APIMessageUserSelectInteractionData, - APIModalSubmission, - APIModalSubmitInteraction, - APITextInputComponent, - APIUserApplicationCommandInteraction, - APIUserApplicationCommandInteractionData, - GatewayInteractionCreateDispatchData, - MessageFlags, - ObjectToLower, - OmitInsert, - RESTPostAPIInteractionCallbackJSONBody, - ToClass, - When, -} from '../common'; -import { ApplicationCommandType, ComponentType, InteractionResponseType, InteractionType } from '../common'; +import type { ObjectToLower, OmitInsert, ToClass, When } from '../common'; import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, diff --git a/src/structures/Message.ts b/src/structures/Message.ts index 675c8c4..d5496d0 100644 --- a/src/structures/Message.ts +++ b/src/structures/Message.ts @@ -1,13 +1,13 @@ -import type { ListenerOptions } from '../builders'; -import type { UsingClient } from '../commands'; import type { APIChannelMention, APIGuildMember, APIMessage, APIUser, GatewayMessageCreateDispatchData, - ObjectToLower, -} from '../common'; +} from 'discord-api-types/v10'; +import type { ListenerOptions } from '../builders'; +import type { UsingClient } from '../commands'; +import type { ObjectToLower } from '../common'; import type { EmojiResolvable } from '../common/types/resolvables'; import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write'; import type { ActionRowMessageComponents } from '../components'; diff --git a/src/structures/Sticker.ts b/src/structures/Sticker.ts index ec7feff..a7e998d 100644 --- a/src/structures/Sticker.ts +++ b/src/structures/Sticker.ts @@ -1,12 +1,11 @@ -import type { UsingClient } from '..'; -import type { Attachment } from '../builders'; import type { APISticker, - MethodContext, - ObjectToLower, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody, -} from '../common'; +} from 'discord-api-types/v10'; +import type { UsingClient } from '..'; +import type { Attachment } from '../builders'; +import type { MethodContext, ObjectToLower } from '../common'; import { User } from './User'; import { DiscordBase } from './extra/DiscordBase'; diff --git a/src/structures/User.ts b/src/structures/User.ts index 6e3b624..4629334 100644 --- a/src/structures/User.ts +++ b/src/structures/User.ts @@ -1,4 +1,5 @@ -import type { APIUser, MessageCreateBodyRequest, ObjectToLower } from '../common'; +import type { APIUser } from 'discord-api-types/v10'; +import type { MessageCreateBodyRequest, ObjectToLower } from '../common'; import type { ImageOptions } from '../common/types/options'; import { DiscordBase } from './extra/DiscordBase'; diff --git a/src/structures/Webhook.ts b/src/structures/Webhook.ts index 1a0cfca..fd4f777 100644 --- a/src/structures/Webhook.ts +++ b/src/structures/Webhook.ts @@ -1,16 +1,18 @@ -import type { UsingClient } from '../commands'; import type { APIWebhook, + RESTGetAPIWebhookWithTokenMessageQuery, + RESTPatchAPIWebhookJSONBody, + RESTPatchAPIWebhookWithTokenJSONBody, + RESTPostAPIWebhookWithTokenQuery, +} from 'discord-api-types/v10'; +import type { UsingClient } from '../commands'; +import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower, - RESTGetAPIWebhookWithTokenMessageQuery, - RESTPatchAPIWebhookJSONBody, - RESTPatchAPIWebhookWithTokenJSONBody, - RESTPostAPIWebhookWithTokenQuery, } from '../common'; import { AnonymousGuild } from './AnonymousGuild'; import { User } from './User'; diff --git a/src/structures/channels.ts b/src/structures/channels.ts index f27c45b..3ea183f 100644 --- a/src/structures/channels.ts +++ b/src/structures/channels.ts @@ -1,6 +1,16 @@ import { + type APIChannelBase, + type APIGuildChannel, + type APIGuildForumDefaultReactionEmoji, + type APIGuildForumTag, ChannelFlags, ChannelType, + type RESTGetAPIChannelMessageReactionUsersQuery, + type RESTPatchAPIChannelJSONBody, + type RESTPatchAPIGuildChannelPositionsJSONBody, + type RESTPostAPIChannelWebhookJSONBody, + type RESTPostAPIGuildChannelJSONBody, + type SortOrderType, VideoQualityMode, type APIDMChannel, type APIGuildCategoryChannel, @@ -17,21 +27,11 @@ import { mix } from 'ts-mixer'; import { Embed, resolveAttachment } from '../builders'; import type { UsingClient } from '../commands'; import type { - APIChannelBase, - APIGuildChannel, - APIGuildForumDefaultReactionEmoji, - APIGuildForumTag, EmojiResolvable, MessageCreateBodyRequest, MessageUpdateBodyRequest, MethodContext, ObjectToLower, - RESTGetAPIChannelMessageReactionUsersQuery, - RESTPatchAPIChannelJSONBody, - RESTPatchAPIGuildChannelPositionsJSONBody, - RESTPostAPIChannelWebhookJSONBody, - RESTPostAPIGuildChannelJSONBody, - SortOrderType, StringToNumber, ToClass, } from '../common'; diff --git a/src/structures/extra/BaseGuild.ts b/src/structures/extra/BaseGuild.ts index a2347b6..2e17df1 100644 --- a/src/structures/extra/BaseGuild.ts +++ b/src/structures/extra/BaseGuild.ts @@ -1,5 +1,5 @@ -import type { APIPartialGuild, ObjectToLower } from '../../common'; -import { GuildFeature } from '../../common'; +import { type APIPartialGuild, GuildFeature } from 'discord-api-types/v10'; +import type { ObjectToLower } from '../../common'; import type { ImageOptions } from '../../common/types/options'; import { DiscordBase } from './DiscordBase'; diff --git a/src/structures/extra/functions.ts b/src/structures/extra/functions.ts index a38b501..44c8b9d 100644 --- a/src/structures/extra/functions.ts +++ b/src/structures/extra/functions.ts @@ -1,6 +1,8 @@ +import { FormattingPatterns } from 'discord-api-types/globals'; +import type { APIPartialEmoji } from 'discord-api-types/v10'; import type { Cache } from '../../cache'; -import type { APIPartialEmoji, TypeArray } from '../../common'; -import { DiscordEpoch, FormattingPatterns } from '../../common'; +import type { TypeArray } from '../../common'; +import { DiscordEpoch } from '../../common'; import type { EmojiResolvable } from '../../common/types/resolvables'; /** * Convert a timestamp to a snowflake. * @param timestamp The timestamp to convert. * @returns The snowflake. */ diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..86ea8c3 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1 @@ +export * from 'discord-api-types/v10'; diff --git a/src/websocket/SharedTypes.ts b/src/websocket/SharedTypes.ts index 56a0f08..54043b6 100644 --- a/src/websocket/SharedTypes.ts +++ b/src/websocket/SharedTypes.ts @@ -1,63 +1,63 @@ -import type { - APIAuditLogEntry, - APIAutoModerationRule, - APIChannel, - APIEntitlement, - APIGuild, - APIGuildMember, - APIGuildScheduledEvent, - APIStageInstance, - APIUser, - GatewayActivity, - GatewayAutoModerationActionExecutionDispatchData, - GatewayChannelPinsUpdateDispatchData, - GatewayChannelUpdateDispatchData, +import { + type APIAuditLogEntry, + type APIAutoModerationRule, + type APIChannel, + type APIEntitlement, + type APIGuild, + type APIGuildMember, + type APIGuildScheduledEvent, + type APIStageInstance, + type APIUser, + type GatewayActivity, + type GatewayAutoModerationActionExecutionDispatchData, + type GatewayChannelPinsUpdateDispatchData, + type GatewayChannelUpdateDispatchData, GatewayDispatchEvents, - GatewayGuildBanAddDispatchData, - GatewayGuildBanRemoveDispatchData, - GatewayGuildCreateDispatchData, - GatewayGuildDeleteDispatchData, - GatewayGuildEmojisUpdateDispatchData, - GatewayGuildIntegrationsUpdateDispatchData, - GatewayGuildMemberRemoveDispatchData, - GatewayGuildMemberUpdateDispatchData, - GatewayGuildMembersChunkDispatchData, - GatewayGuildRoleCreateDispatchData, - GatewayGuildRoleDeleteDispatchData, - GatewayGuildRoleUpdateDispatchData, - GatewayGuildScheduledEventUserRemoveDispatchData, - GatewayGuildStickersUpdateDispatchData, - GatewayIntegrationCreateDispatchData, - GatewayIntegrationDeleteDispatchData, - GatewayInteractionCreateDispatchData, - GatewayInviteCreateDispatchData, - GatewayInviteDeleteDispatchData, - GatewayMessageCreateDispatchData, - GatewayMessageDeleteBulkDispatchData, - GatewayMessageDeleteDispatchData, - GatewayMessageReactionAddDispatchData, - GatewayMessageReactionRemoveAllDispatchData, - GatewayMessageReactionRemoveDispatchData, - GatewayMessageReactionRemoveEmojiDispatchData, - GatewayMessageUpdateDispatchData, - GatewayPresenceUpdateData, - GatewayPresenceUpdateDispatchData, - GatewayReadyDispatchData, - GatewayRequestGuildMembersDataWithQuery, - GatewayRequestGuildMembersDataWithUserIds, - GatewayThreadCreateDispatchData, - GatewayThreadDeleteDispatchData, - GatewayThreadListSyncDispatchData, - GatewayThreadMemberUpdateDispatchData, - GatewayThreadMembersUpdateDispatchData, - GatewayTypingStartDispatchData, - GatewayUserUpdateDispatchData, - GatewayVoiceServerUpdateDispatchData, - GatewayVoiceStateUpdateData, - GatewayWebhooksUpdateDispatchData, - PresenceUpdateStatus, - RestToKeys, -} from '../common'; + type GatewayGuildBanAddDispatchData, + type GatewayGuildBanRemoveDispatchData, + type GatewayGuildCreateDispatchData, + type GatewayGuildDeleteDispatchData, + type GatewayGuildEmojisUpdateDispatchData, + type GatewayGuildIntegrationsUpdateDispatchData, + type GatewayGuildMemberRemoveDispatchData, + type GatewayGuildMemberUpdateDispatchData, + type GatewayGuildMembersChunkDispatchData, + type GatewayGuildRoleCreateDispatchData, + type GatewayGuildRoleDeleteDispatchData, + type GatewayGuildRoleUpdateDispatchData, + type GatewayGuildScheduledEventUserRemoveDispatchData, + type GatewayGuildStickersUpdateDispatchData, + type GatewayIntegrationCreateDispatchData, + type GatewayIntegrationDeleteDispatchData, + type GatewayInteractionCreateDispatchData, + type GatewayInviteCreateDispatchData, + type GatewayInviteDeleteDispatchData, + type GatewayMessageCreateDispatchData, + type GatewayMessageDeleteBulkDispatchData, + type GatewayMessageDeleteDispatchData, + type GatewayMessageReactionAddDispatchData, + type GatewayMessageReactionRemoveAllDispatchData, + type GatewayMessageReactionRemoveDispatchData, + type GatewayMessageReactionRemoveEmojiDispatchData, + type GatewayMessageUpdateDispatchData, + type GatewayPresenceUpdateData, + type GatewayPresenceUpdateDispatchData, + type GatewayReadyDispatchData, + type GatewayRequestGuildMembersDataWithQuery, + type GatewayRequestGuildMembersDataWithUserIds, + type GatewayThreadCreateDispatchData, + type GatewayThreadDeleteDispatchData, + type GatewayThreadListSyncDispatchData, + type GatewayThreadMemberUpdateDispatchData, + type GatewayThreadMembersUpdateDispatchData, + type GatewayTypingStartDispatchData, + type GatewayUserUpdateDispatchData, + type GatewayVoiceServerUpdateDispatchData, + type GatewayVoiceStateUpdateData, + type GatewayWebhooksUpdateDispatchData, + type PresenceUpdateStatus, +} from 'discord-api-types/v10'; +import type { RestToKeys } from '../common'; import type { GatewayGuildMemberAddDispatchDataFixed } from '../structures'; /** https://discord.com/developers/docs/topics/gateway-events#update-presence */ diff --git a/src/websocket/constants/index.ts b/src/websocket/constants/index.ts index b44935a..2777a46 100644 --- a/src/websocket/constants/index.ts +++ b/src/websocket/constants/index.ts @@ -1,4 +1,4 @@ -import type { GatewayDispatchPayload } from '../../common'; +import type { GatewayDispatchPayload } from 'discord-api-types/v10'; import type { ShardManagerOptions, WorkerManagerOptions } from '../discord'; const COMPRESS = false; diff --git a/src/websocket/discord/shard.ts b/src/websocket/discord/shard.ts index 1573835..c0644d2 100644 --- a/src/websocket/discord/shard.ts +++ b/src/websocket/discord/shard.ts @@ -1,8 +1,9 @@ +import type { GatewayReceivePayload, GatewaySendPayload } from 'discord-api-types/v10'; +import { GatewayCloseCodes, GatewayDispatchEvents, GatewayOpcodes } from 'discord-api-types/v10'; import { inflateSync } from 'node:zlib'; import type WS from 'ws'; import { WebSocket, type CloseEvent, type ErrorEvent } from 'ws'; -import type { GatewayReceivePayload, GatewaySendPayload, Logger } from '../../common'; -import { GatewayCloseCodes, GatewayDispatchEvents, GatewayOpcodes } from '../../common'; +import type { Logger } from '../../common'; import { properties } from '../constants'; import { DynamicBucket, PriorityQueue } from '../structures'; import { ConnectTimeout } from '../structures/timeout'; diff --git a/src/websocket/discord/sharder.ts b/src/websocket/discord/sharder.ts index 0c8736c..609ade9 100644 --- a/src/websocket/discord/sharder.ts +++ b/src/websocket/discord/sharder.ts @@ -1,13 +1,15 @@ -import { parentPort, workerData } from 'node:worker_threads'; import { GatewayOpcodes, + type GatewaySendPayload, + type GatewayUpdatePresence, + type GatewayVoiceStateUpdate, +} from 'discord-api-types/v10'; +import { parentPort, workerData } from 'node:worker_threads'; +import { LogLevels, Logger, MergeOptions, toSnakeCase, - type GatewaySendPayload, - type GatewayUpdatePresence, - type GatewayVoiceStateUpdate, type ObjectToLower, type WatcherSendToShard, } from '../../common'; diff --git a/src/websocket/discord/shared.ts b/src/websocket/discord/shared.ts index 7036b37..3aa915f 100644 --- a/src/websocket/discord/shared.ts +++ b/src/websocket/discord/shared.ts @@ -3,8 +3,8 @@ import type { GatewayDispatchPayload, GatewayIntentBits, GatewayPresenceUpdateData, - Logger, -} from '../../common'; +} from 'discord-api-types/v10'; +import type { Logger } from '../../common'; import type { IdentifyProperties } from '../constants'; export interface ShardManagerOptions extends ShardDetails { diff --git a/src/websocket/discord/worker.ts b/src/websocket/discord/worker.ts index 7811855..4c6fc0c 100644 --- a/src/websocket/discord/worker.ts +++ b/src/websocket/discord/worker.ts @@ -1,5 +1,5 @@ +import type { GatewayDispatchPayload } from 'discord-api-types/v10'; import type { ApiRequestOptions, HttpMethods } from '../..'; -import type { GatewayDispatchPayload } from '../../common'; export interface WorkerShardInfo { open: boolean; diff --git a/src/websocket/discord/workermanager.ts b/src/websocket/discord/workermanager.ts index 23b9efe..cbbd32d 100644 --- a/src/websocket/discord/workermanager.ts +++ b/src/websocket/discord/workermanager.ts @@ -1,16 +1,11 @@ +import type { GatewayPresenceUpdateData, GatewaySendPayload } from 'discord-api-types/v10'; import cluster, { type Worker as ClusterWorker } from 'node:cluster'; import { randomUUID } from 'node:crypto'; import { Worker as ThreadWorker } from 'node:worker_threads'; -import { ApiHandler, Router } from '../..'; +import { ApiHandler, Logger, Router } from '../..'; import { MemoryAdapter, type Adapter } from '../../cache'; import { BaseClient, type InternalRuntimeConfig } from '../../client/base'; -import { - Logger, - MergeOptions, - type GatewayPresenceUpdateData, - type GatewaySendPayload, - type MakePartial, -} from '../../common'; +import { type MakePartial, MergeOptions } from '../../common'; import { WorkerManagerDefaults } from '../constants'; import { SequentialBucket } from '../structures'; import { ConnectQueue } from '../structures/timeout';