chore: bump 3.2.1

This commit is contained in:
Socram03 2025-06-17 16:19:49 -04:00
parent 325a39f1bf
commit db38f49ca9
68 changed files with 341 additions and 659 deletions

View File

@ -1 +1 @@
npx lint-staged npx biome check --write

View File

@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"vcs": { "vcs": {
"enabled": true, "enabled": true,
"clientKind": "git", "clientKind": "git",
@ -8,7 +8,16 @@
}, },
"files": { "files": {
"ignoreUnknown": true, "ignoreUnknown": true,
"ignore": ["node_modules/", "build", "lib", "__test__", "package.json", "tsconfig.json", ".vscode"] "includes": [
"**/src/**",
"!/node_modules/",
"!/build",
"!/lib",
"!/__test__",
"!/package.json",
"!/tsconfig.json",
"!/.vscode"
]
}, },
"formatter": { "formatter": {
"enabled": true, "enabled": true,
@ -18,14 +27,17 @@
"lineEnding": "crlf", "lineEnding": "crlf",
"formatWithErrors": true "formatWithErrors": true
}, },
"organizeImports": { "assist": {
"enabled": true "actions": {
"source": {
"organizeImports": "on"
}
}
}, },
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": false, "recommended": false,
"all": true,
"security": { "security": {
"noGlobalEval": "off" "noGlobalEval": "off"
}, },
@ -41,9 +53,7 @@
}, },
"correctness": { "correctness": {
"noNodejsModules": "off", "noNodejsModules": "off",
"useImportExtensions": "off", "useImportExtensions": "off"
"noUnusedFunctionParameters": "off",
"noUnusedVariables": "off"
}, },
"style": { "style": {
"noDefaultExport": "off", "noDefaultExport": "off",
@ -56,8 +66,7 @@
"noParameterAssign": "off", "noParameterAssign": "off",
"useFilenamingConvention": "off", "useFilenamingConvention": "off",
"useEnumInitializers": "off", "useEnumInitializers": "off",
"useExplicitLengthCheck": "off", "useExplicitLengthCheck": "off"
"noNamespaceImport": "off"
}, },
"complexity": { "complexity": {
"noForEach": "off", "noForEach": "off",
@ -69,7 +78,8 @@
"noBarrelFile": "off", "noBarrelFile": "off",
"noDelete": "off", "noDelete": "off",
"noReExportAll": "off", "noReExportAll": "off",
"useTopLevelRegex": "off" "useTopLevelRegex": "off",
"noNamespaceImport": "off"
} }
} }
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "seyfert", "name": "seyfert",
"version": "3.2.0", "version": "3.2.1",
"description": "The most advanced framework for discord bots", "description": "The most advanced framework for discord bots",
"main": "./lib/index.js", "main": "./lib/index.js",
"module": "./lib/index.js", "module": "./lib/index.js",
@ -21,15 +21,14 @@
"author": "MARCROCK22", "author": "MARCROCK22",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@biomejs/biome": "1.9.4", "@biomejs/biome": "2.0.0",
"@changesets/cli": "^2.29.4", "@changesets/cli": "^2.29.4",
"@commitlint/cli": "^19.8.1", "@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1", "@commitlint/config-conventional": "^19.8.1",
"@types/node": "^24.0.1", "@types/node": "^24.0.3",
"husky": "^9.1.7", "husky": "^9.1.7",
"lint-staged": "^15.5.1",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vitest": "^3.2.3" "vitest": "^3.2.4"
}, },
"homepage": "https://seyfert.dev", "homepage": "https://seyfert.dev",
"repository": { "repository": {
@ -65,11 +64,6 @@
"url": "https://github.com/Drylozu" "url": "https://github.com/Drylozu"
} }
], ],
"lint-staged": {
"*.ts": [
"biome check --write"
]
},
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"@biomejs/biome", "@biomejs/biome",

529
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -39,10 +39,10 @@ import type {
RESTGetAPIGuildRolesResult, RESTGetAPIGuildRolesResult,
RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventQuery,
RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventResult,
RESTGetAPIGuildScheduledEventUsersQuery,
RESTGetAPIGuildScheduledEventUsersResult,
RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsQuery,
RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildScheduledEventsResult,
RESTGetAPIGuildScheduledEventUsersQuery,
RESTGetAPIGuildScheduledEventUsersResult,
RESTGetAPIGuildSoundboardSoundsResult, RESTGetAPIGuildSoundboardSoundsResult,
RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickerResult,
RESTGetAPIGuildStickersResult, RESTGetAPIGuildStickersResult,
@ -107,12 +107,12 @@ import type {
RESTPostAPIGuildSoundboardSoundResult, RESTPostAPIGuildSoundboardSoundResult,
RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerFormDataBody,
RESTPostAPIGuildStickerResult, RESTPostAPIGuildStickerResult,
RESTPostAPIGuildTemplatesJSONBody,
RESTPostAPIGuildTemplatesResult,
RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsJSONBody,
RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAJSONBody,
RESTPostAPIGuildsMFAResult, RESTPostAPIGuildsMFAResult,
RESTPostAPIGuildsResult, RESTPostAPIGuildsResult,
RESTPostAPIGuildTemplatesJSONBody,
RESTPostAPIGuildTemplatesResult,
RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildJSONBody,
RESTPostAPITemplateCreateGuildResult, RESTPostAPITemplateCreateGuildResult,
RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanJSONBody,

View File

@ -1,11 +1,11 @@
import { type UUID, randomUUID } from 'node:crypto'; import { randomUUID, type UUID } from 'node:crypto';
import { type Awaitable, BASE_HOST, Logger, delay, lazyLoadPackage, snowflakeToTimestamp } from '../common'; import { type Awaitable, BASE_HOST, delay, Logger, lazyLoadPackage, snowflakeToTimestamp } from '../common';
import { toArrayBuffer, toBuffer } from '../common/it/utils'; import { toArrayBuffer, toBuffer } from '../common/it/utils';
import type { WorkerData } from '../websocket'; import type { WorkerData } from '../websocket';
import type { WorkerSendApiRequest } from '../websocket/discord/worker'; import type { WorkerSendApiRequest } from '../websocket/discord/worker';
import { Bucket } from './bucket';
import { CDNRouter, Router } from './Router'; import { CDNRouter, Router } from './Router';
import type { APIRoutes } from './Routes'; import type { APIRoutes } from './Routes';
import { Bucket } from './bucket';
import { import {
type ApiHandlerInternalOptions, type ApiHandlerInternalOptions,
type ApiHandlerOptions, type ApiHandlerOptions,
@ -384,11 +384,7 @@ export class ApiHandler {
} }
} }
parseRequest(options: { parseRequest(options: { url: string; headers: RequestHeaders; request: ApiRequestOptions }) {
url: string;
headers: RequestHeaders;
request: ApiRequestOptions;
}) {
let finalUrl = options.url; let finalUrl = options.url;
let data: string | FormData | undefined; let data: string | FormData | undefined;
if (options.request.auth) { if (options.request.auth) {

View File

@ -1,4 +1,4 @@
export * from './api';
export * from './Router'; export * from './Router';
export * from './Routes'; export * from './Routes';
export * from './api';
export * from './shared'; export * from './shared';

View File

@ -1,6 +1,6 @@
import { type ActionRow, fromComponent } from '.';
import { type ColorResolvable, type RestOrArray, resolveColor } from '../common'; import { type ColorResolvable, type RestOrArray, resolveColor } from '../common';
import { type APIContainerComponent, ComponentType } from '../types'; import { type APIContainerComponent, ComponentType } from '../types';
import { type ActionRow, fromComponent } from '.';
import { BaseComponentBuilder } from './Base'; import { BaseComponentBuilder } from './Base';
import type { File } from './File'; import type { File } from './File';
import type { MediaGallery } from './MediaGallery'; import type { MediaGallery } from './MediaGallery';

View File

@ -1,6 +1,6 @@
import { type Button, fromComponent } from '.';
import type { RestOrArray } from '../common'; import type { RestOrArray } from '../common';
import { type APISectionComponent, ComponentType } from '../types'; import { type APISectionComponent, ComponentType } from '../types';
import { type Button, fromComponent } from '.';
import { BaseComponentBuilder } from './Base'; import { BaseComponentBuilder } from './Base';
import type { TextDisplay } from './TextDisplay'; import type { TextDisplay } from './TextDisplay';
import type { Thumbnail } from './Thumbnail'; import type { Thumbnail } from './Thumbnail';

12
src/cache/index.ts vendored
View File

@ -1,11 +1,5 @@
import { type If, Logger } from '../common';
import type { Adapter } from './adapters';
import { Guilds } from './resources/guilds';
import { Users } from './resources/users';
import type { InternalOptions, UsingClient } from '../commands'; import type { InternalOptions, UsingClient } from '../commands';
import { type If, Logger } from '../common';
import { import {
type APIChannel, type APIChannel,
type APIEmoji, type APIEmoji,
@ -20,9 +14,11 @@ import {
GuildMemberFlags, GuildMemberFlags,
OverwriteType, OverwriteType,
} from '../types'; } from '../types';
import type { Adapter } from './adapters';
import { Bans } from './resources/bans'; import { Bans } from './resources/bans';
import { Channels } from './resources/channels'; import { Channels } from './resources/channels';
import { Emojis } from './resources/emojis'; import { Emojis } from './resources/emojis';
import { Guilds } from './resources/guilds';
import { Members } from './resources/members'; import { Members } from './resources/members';
import { Messages } from './resources/messages'; import { Messages } from './resources/messages';
import { Overwrites } from './resources/overwrites'; import { Overwrites } from './resources/overwrites';
@ -30,7 +26,9 @@ import { Presences } from './resources/presence';
import { Roles } from './resources/roles'; import { Roles } from './resources/roles';
import { StageInstances } from './resources/stage-instances'; import { StageInstances } from './resources/stage-instances';
import { Stickers } from './resources/stickers'; import { Stickers } from './resources/stickers';
import { Users } from './resources/users';
import { VoiceStates } from './resources/voice-states'; import { VoiceStates } from './resources/voice-states';
export { BaseResource } from './resources/default/base'; export { BaseResource } from './resources/default/base';
export { GuildBasedResource } from './resources/default/guild-based'; export { GuildBasedResource } from './resources/default/guild-based';
export { GuildRelatedResource } from './resources/default/guild-related'; export { GuildRelatedResource } from './resources/default/guild-related';

View File

@ -1,7 +1,7 @@
import type { Cache, CacheFrom, ReturnCache } from '..';
import { type GuildStructure, Transformers } from '../../client/transformers'; import { type GuildStructure, Transformers } from '../../client/transformers';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types'; import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types';
import type { Cache, CacheFrom, ReturnCache } from '..';
import { BaseResource } from './default/base'; import { BaseResource } from './default/base';
export class Guilds extends BaseResource<any, APIGuild | GatewayGuildCreateDispatchData> { export class Guilds extends BaseResource<any, APIGuild | GatewayGuildCreateDispatchData> {

View File

@ -1,5 +1,7 @@
import { promises } from 'node:fs';
import { join } from 'node:path'; import { join } from 'node:path';
import { ApiHandler } from '../api'; import { ApiHandler } from '../api';
import { isBufferLike } from '../api/utils/utils';
import type { Adapter, DisabledCache } from '../cache'; import type { Adapter, DisabledCache } from '../cache';
import { Cache, MemoryAdapter } from '../cache'; import { Cache, MemoryAdapter } from '../cache';
import type { import type {
@ -16,34 +18,31 @@ import type {
UsingClient, UsingClient,
} from '../commands'; } from '../commands';
import { IgnoreCommand, type InferWithPrefix, type MiddlewareContext } from '../commands/applications/shared'; import { IgnoreCommand, type InferWithPrefix, type MiddlewareContext } from '../commands/applications/shared';
import { HandleCommand } from '../commands/handle';
import { CommandHandler } from '../commands/handler'; import { CommandHandler } from '../commands/handler';
import { import {
ApplicationShorter, ApplicationShorter,
assertString,
ChannelShorter, ChannelShorter,
EmojiShorter, EmojiShorter,
filterSplit,
GuildShorter, GuildShorter,
InteractionShorter, InteractionShorter,
InvitesShorter, InvitesShorter,
LogLevels,
Logger, Logger,
LogLevels,
type MakeRequired, type MakeRequired,
MemberShorter, MemberShorter,
MergeOptions, MergeOptions,
MessageShorter, MessageShorter,
magicImport,
ReactionShorter, ReactionShorter,
RoleShorter, RoleShorter,
TemplateShorter, TemplateShorter,
ThreadShorter, ThreadShorter,
UsersShorter, UsersShorter,
WebhookShorter, WebhookShorter,
assertString,
filterSplit,
magicImport,
} from '../common'; } from '../common';
import { promises } from 'node:fs';
import { isBufferLike } from '../api/utils/utils';
import { HandleCommand } from '../commands/handle';
import { BanShorter } from '../common/shorters/bans'; import { BanShorter } from '../common/shorters/bans';
import { SoundboardShorter } from '../common/shorters/soundboard'; import { SoundboardShorter } from '../common/shorters/soundboard';
import { VoiceStateShorter } from '../common/shorters/voiceStates'; import { VoiceStateShorter } from '../common/shorters/voiceStates';

View File

@ -1,17 +1,17 @@
import type { CommandContext, Message } from '..'; import type { CommandContext, Message } from '..';
import { import {
type Awaitable, type Awaitable,
assertString,
type DeepPartial, type DeepPartial,
type If, type If,
lazyLoadPackage,
type PickPartial, type PickPartial,
type WatcherPayload, type WatcherPayload,
type WatcherSendToShard, type WatcherSendToShard,
assertString,
lazyLoadPackage,
} from '../common'; } from '../common';
import { EventHandler } from '../events'; import { EventHandler } from '../events';
import type { GatewayDispatchPayload, GatewayPresenceUpdateData } from '../types'; import type { GatewayDispatchPayload, GatewayPresenceUpdateData } from '../types';
import { ShardManager, type ShardManagerOptions, properties } from '../websocket'; import { properties, ShardManager, type ShardManagerOptions } from '../websocket';
import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate'; import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate';
import { PresenceUpdateHandler } from '../websocket/discord/events/presenceUpdate'; import { PresenceUpdateHandler } from '../websocket/discord/events/presenceUpdate';
import type { BaseClientOptions, InternalRuntimeConfig, ServicesOptions, StartOptions } from './base'; import type { BaseClientOptions, InternalRuntimeConfig, ServicesOptions, StartOptions } from './base';

View File

@ -1,4 +1,4 @@
import { type UUID, randomUUID } from 'node:crypto'; import { randomUUID, type UUID } from 'node:crypto';
import type { UsingClient } from '../commands'; import type { UsingClient } from '../commands';
import type { Awaitable, CamelCase } from '../common'; import type { Awaitable, CamelCase } from '../common';
import type { CallbackEventHandler, CustomEventsKeys, GatewayEvents } from '../events'; import type { CallbackEventHandler, CustomEventsKeys, GatewayEvents } from '../events';

View File

@ -1,5 +1,5 @@
export type { RuntimeConfig, RuntimeConfigHTTP } from './base'; export type { RuntimeConfig, RuntimeConfigHTTP } from './base';
export * from './client'; export * from './client';
export * from './httpclient'; export * from './httpclient';
export * from './workerclient';
export * from './transformers'; export * from './transformers';
export * from './workerclient';

View File

@ -8,8 +8,8 @@ import {
BaseGuildChannel, BaseGuildChannel,
CategoryChannel, CategoryChannel,
ClientUser, ClientUser,
DMChannel,
DirectoryChannel, DirectoryChannel,
DMChannel,
Emoji, Emoji,
Entitlement, Entitlement,
ForumChannel, ForumChannel,

View File

@ -1,18 +1,22 @@
import { type UUID, randomUUID } from 'node:crypto'; import { randomUUID, type UUID } from 'node:crypto';
import { ApiHandler, Logger } from '..'; import { ApiHandler, Logger } from '..';
import { WorkerAdapter } from '../cache'; import { WorkerAdapter } from '../cache';
import { import {
type Awaitable, type Awaitable,
calculateShardId,
type DeepPartial, type DeepPartial,
LogLevels, LogLevels,
lazyLoadPackage,
type MakeRequired, type MakeRequired,
type When, type When,
calculateShardId,
lazyLoadPackage,
} from '../common'; } from '../common';
import { EventHandler } from '../events'; import { EventHandler } from '../events';
import type { GatewayDispatchPayload, GatewaySendPayload } from '../types'; import type { GatewayDispatchPayload, GatewaySendPayload } from '../types';
import { Shard, type ShardManagerOptions, ShardSocketCloseCodes, type WorkerData, properties } from '../websocket'; import { properties, Shard, type ShardManagerOptions, ShardSocketCloseCodes, type WorkerData } from '../websocket';
import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate';
import { PresenceUpdateHandler } from '../websocket/discord/events/presenceUpdate';
import type { WorkerHeartbeaterMessages } from '../websocket/discord/heartbeater';
import type { ShardData } from '../websocket/discord/shared';
import type { import type {
ClientHeartbeaterMessages, ClientHeartbeaterMessages,
WorkerDisconnectedAllShardsResharding, WorkerDisconnectedAllShardsResharding,
@ -36,11 +40,6 @@ import type { ManagerMessages, ManagerSpawnShards } from '../websocket/discord/w
import type { BaseClientOptions, ServicesOptions, StartOptions } from './base'; import type { BaseClientOptions, ServicesOptions, StartOptions } from './base';
import { BaseClient } from './base'; import { BaseClient } from './base';
import type { Client, ClientOptions } from './client'; import type { Client, ClientOptions } from './client';
import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate';
import { PresenceUpdateHandler } from '../websocket/discord/events/presenceUpdate';
import type { WorkerHeartbeaterMessages } from '../websocket/discord/heartbeater';
import type { ShardData } from '../websocket/discord/shared';
import { Collectors } from './collectors'; import { Collectors } from './collectors';
import { type ClientUserStructure, Transformers } from './transformers'; import { type ClientUserStructure, Transformers } from './transformers';

View File

@ -1,4 +1,4 @@
import { type PermissionStrings, magicImport } from '../../common'; import { magicImport, type PermissionStrings } from '../../common';
import { import {
ApplicationCommandType, ApplicationCommandType,
type ApplicationIntegrationType, type ApplicationIntegrationType,

View File

@ -1,4 +1,4 @@
import { type PermissionStrings, magicImport } from '../../common'; import { magicImport, type PermissionStrings } from '../../common';
import type { import type {
ApplicationCommandType, ApplicationCommandType,
ApplicationIntegrationType, ApplicationIntegrationType,

View File

@ -13,9 +13,9 @@ import {
type MakeRequired, type MakeRequired,
type MessageWebhookCreateBodyRequest, type MessageWebhookCreateBodyRequest,
type ModalCreateBodyRequest, type ModalCreateBodyRequest,
toSnakeCase,
type UnionToTuple, type UnionToTuple,
type When, type When,
toSnakeCase,
} from '../../common'; } from '../../common';
import type { AllChannels, MessageCommandInteraction, UserCommandInteraction } from '../../structures'; import type { AllChannels, MessageCommandInteraction, UserCommandInteraction } from '../../structures';
import { type APIMessage, ApplicationCommandType, MessageFlags, type RESTGetAPIGuildQuery } from '../../types'; import { type APIMessage, ApplicationCommandType, MessageFlags, type RESTGetAPIGuildQuery } from '../../types';
@ -47,7 +47,6 @@ export class MenuCommandContext<
metadata: CommandMetadata<UnionToTuple<M>> = {} as never; metadata: CommandMetadata<UnionToTuple<M>> = {} as never;
globalMetadata: GlobalMetadata = {}; globalMetadata: GlobalMetadata = {};
// biome-ignore lint/suspicious/useGetterReturn: default don't exist.
get target(): InteractionTarget<T> { get target(): InteractionTarget<T> {
switch (this.interaction.data.type) { switch (this.interaction.data.type) {
case ApplicationCommandType.Message: { case ApplicationCommandType.Message: {

View File

@ -1,10 +1,3 @@
import type {
AutocompleteCallback,
EntryPointContext,
MenuCommandContext,
OnAutocompleteErrorCallback,
ReturnOptionsTypes,
} from '..';
import type { Awaitable, FlatObjectKeys } from '../../common'; import type { Awaitable, FlatObjectKeys } from '../../common';
import type { ModalContext } from '../../components'; import type { ModalContext } from '../../components';
import type { ComponentContext } from '../../components/componentcontext'; import type { ComponentContext } from '../../components/componentcontext';
@ -15,6 +8,13 @@ import {
ApplicationCommandOptionType, ApplicationCommandOptionType,
} from '../../types'; } from '../../types';
import type { LocalizationMap } from '../../types/payloads'; import type { LocalizationMap } from '../../types/payloads';
import type {
AutocompleteCallback,
EntryPointContext,
MenuCommandContext,
OnAutocompleteErrorCallback,
ReturnOptionsTypes,
} from '..';
import type { CommandContext } from './chatcontext'; import type { CommandContext } from './chatcontext';
import type { DefaultLocale, MiddlewareContext, OKFunction, SeyfertChannelMap, StopFunction } from './shared'; import type { DefaultLocale, MiddlewareContext, OKFunction, SeyfertChannelMap, StopFunction } from './shared';

View File

@ -1,7 +1,7 @@
import type { import type {
CategoryChannelStructure, CategoryChannelStructure,
DMChannelStructure,
DirectoryChannelStructure, DirectoryChannelStructure,
DMChannelStructure,
ForumChannelStructure, ForumChannelStructure,
MediaChannelStructure, MediaChannelStructure,
NewsChannelStructure, NewsChannelStructure,

View File

@ -1,3 +1,32 @@
import type { Client, WorkerClient } from '../client';
import { type MessageStructure, type OptionResolverStructure, Transformers } from '../client/transformers';
import type { MakeRequired } from '../common';
import { INTEGER_OPTION_VALUE_LIMIT } from '../common/it/constants';
import { ComponentContext, ModalContext } from '../components';
import {
type __InternalReplyFunction,
AutocompleteInteraction,
BaseInteraction,
type ChatInputCommandInteraction,
type ComponentInteraction,
type EntryPointInteraction,
type MessageCommandInteraction,
type ModalSubmitInteraction,
type UserCommandInteraction,
} from '../structures';
import type { PermissionsBitField } from '../structures/extra/Permissions';
import {
type APIApplicationCommandInteraction,
type APIApplicationCommandInteractionDataOption,
type APIInteraction,
type APIInteractionDataResolvedChannel,
ApplicationCommandOptionType,
ApplicationCommandType,
ChannelType,
type GatewayMessageCreateDispatchData,
InteractionContextType,
InteractionType,
} from '../types';
import { import {
BaseCommand, BaseCommand,
Command, Command,
@ -19,35 +48,6 @@ import {
SubCommand, SubCommand,
type UsingClient, type UsingClient,
} from '.'; } from '.';
import type { Client, WorkerClient } from '../client';
import { type MessageStructure, type OptionResolverStructure, Transformers } from '../client/transformers';
import type { MakeRequired } from '../common';
import { INTEGER_OPTION_VALUE_LIMIT } from '../common/it/constants';
import { ComponentContext, ModalContext } from '../components';
import {
AutocompleteInteraction,
BaseInteraction,
type ChatInputCommandInteraction,
type ComponentInteraction,
type EntryPointInteraction,
type MessageCommandInteraction,
type ModalSubmitInteraction,
type UserCommandInteraction,
type __InternalReplyFunction,
} from '../structures';
import type { PermissionsBitField } from '../structures/extra/Permissions';
import {
type APIApplicationCommandInteraction,
type APIApplicationCommandInteractionDataOption,
type APIInteraction,
type APIInteractionDataResolvedChannel,
ApplicationCommandOptionType,
ApplicationCommandType,
ChannelType,
type GatewayMessageCreateDispatchData,
InteractionContextType,
InteractionType,
} from '../types';
export type CommandOptionWithType = CommandOption & { export type CommandOptionWithType = CommandOption & {
type: ApplicationCommandOptionType; type: ApplicationCommandOptionType;

View File

@ -1,6 +1,5 @@
import { promises } from 'node:fs'; import { promises } from 'node:fs';
import { basename, dirname } from 'node:path'; import { basename, dirname } from 'node:path';
import type { EntryPointCommand } from '.';
import type { Logger, NulleableCoalising, OmitInsert } from '../common'; import type { Logger, NulleableCoalising, OmitInsert } from '../common';
import { BaseHandler, isCloudfareWorker } from '../common'; import { BaseHandler, isCloudfareWorker } from '../common';
import { PermissionsBitField } from '../structures/extra/Permissions'; import { PermissionsBitField } from '../structures/extra/Permissions';
@ -17,6 +16,7 @@ import {
type LocaleString, type LocaleString,
type LocalizationMap, type LocalizationMap,
} from '../types'; } from '../types';
import type { EntryPointCommand } from '.';
import { Command, type CommandOption, SubCommand } from './applications/chat'; import { Command, type CommandOption, SubCommand } from './applications/chat';
import { ContextMenuCommand } from './applications/menu'; import { ContextMenuCommand } from './applications/menu';
import { IgnoreCommand, type UsingClient } from './applications/shared'; import { IgnoreCommand, type UsingClient } from './applications/shared';

View File

@ -1,11 +1,11 @@
export * from './applications/shared';
// //
export * from './applications/chat'; export * from './applications/chat';
export * from './applications/chatcontext'; export * from './applications/chatcontext';
export * from './applications/entrycontext';
export * from './applications/entryPoint';
export * from './applications/menu'; export * from './applications/menu';
export * from './applications/menucontext'; export * from './applications/menucontext';
export * from './applications/options'; export * from './applications/options';
export * from './applications/entryPoint'; export * from './applications/shared';
export * from './applications/entrycontext';
export * from './decorators'; export * from './decorators';
export * from './optionresolver'; export * from './optionresolver';

View File

@ -1,28 +1,28 @@
export * from './it/constants'; //
export * from './it/utils'; export * from './bot/watcher';
export * from './it/colors'; export * from './it/colors';
export { CustomizeLoggerCallback, AssignFilenameCallback, LogLevels, Logger, LoggerOptions } from './it/logger'; export * from './it/constants';
export * from './it/formatter'; export * from './it/formatter';
// circular lol export { AssignFilenameCallback, CustomizeLoggerCallback, Logger, LoggerOptions, LogLevels } from './it/logger';
export * from './shorters/invites'; export * from './it/utils';
export * from './shorters/application';
// //
export * from './shorters/channels'; export * from './shorters/channels';
export * from './shorters/emojis'; export * from './shorters/emojis';
export * from './shorters/guilds'; export * from './shorters/guilds';
export * from './shorters/interaction';
// circular lol
export * from './shorters/invites';
export * from './shorters/members'; export * from './shorters/members';
export * from './shorters/messages'; export * from './shorters/messages';
export * from './shorters/reactions'; export * from './shorters/reactions';
export * from './shorters/roles'; export * from './shorters/roles';
export * from './shorters/templates'; export * from './shorters/templates';
export * from './shorters/users';
export * from './shorters/threads'; export * from './shorters/threads';
export * from './shorters/users';
export * from './shorters/webhook'; export * from './shorters/webhook';
export * from './shorters/interaction';
export * from './shorters/application';
// //
export * from './types/options'; export * from './types/options';
export * from './types/resolvables'; export * from './types/resolvables';
export * from './types/util'; export * from './types/util';
export * from './types/write'; export * from './types/write';
//
export * from './bot/watcher';

View File

@ -1,4 +1,4 @@
import { type WriteStream, createWriteStream, existsSync, mkdirSync, promises } from 'node:fs'; import { createWriteStream, existsSync, mkdirSync, promises, type WriteStream } from 'node:fs';
import { join } from 'node:path'; import { join } from 'node:path';
import { bgBrightWhite, black, bold, brightBlack, cyan, gray, italic, red, stripColor, yellow } from './colors'; import { bgBrightWhite, black, bold, brightBlack, cyan, gray, italic, red, stripColor, yellow } from './colors';
import { MergeOptions } from './utils'; import { MergeOptions } from './utils';

View File

@ -1,5 +1,7 @@
import { promises } from 'node:fs'; import { promises } from 'node:fs';
import { basename, join } from 'node:path'; import { basename, join } from 'node:path';
import type { Cache } from '../../cache';
import { type APIPartialEmoji, FormattingPatterns, GatewayIntentBits } from '../../types';
import { import {
type ColorResolvable, type ColorResolvable,
DiscordEpoch, DiscordEpoch,
@ -10,8 +12,6 @@ import {
type ObjectToSnake, type ObjectToSnake,
type TypeArray, type TypeArray,
} from '..'; } from '..';
import type { Cache } from '../../cache';
import { type APIPartialEmoji, FormattingPatterns, GatewayIntentBits } from '../../types';
/** /**
* Calculates the shard ID for a guild based on its ID. * Calculates the shard ID for a guild based on its ID.
@ -304,8 +304,6 @@ export function lazyLoadPackage<T>(mod: string): T | undefined {
try { try {
return require(mod); return require(mod);
} catch (e) { } catch (e) {
// biome-ignore lint/suspicious/noConsoleLog:
// biome-ignore lint/suspicious/noConsole:
console.log(`Cannot import ${mod}`, e); console.log(`Cannot import ${mod}`, e);
return; return;
} }

View File

@ -1,7 +1,7 @@
import { CacheFrom } from '../../cache'; import { CacheFrom } from '../../cache';
import type { Overwrites } from '../../cache/resources/overwrites'; import type { Overwrites } from '../../cache/resources/overwrites';
import { type MessageStructure, type ThreadChannelStructure, Transformers } from '../../client/transformers'; import { type MessageStructure, type ThreadChannelStructure, Transformers } from '../../client/transformers';
import { type AllChannels, BaseChannel, type GuildMember, type GuildRole, channelFrom } from '../../structures'; import { type AllChannels, BaseChannel, channelFrom, type GuildMember, type GuildRole } from '../../structures';
import { PermissionsBitField } from '../../structures/extra/Permissions'; import { PermissionsBitField } from '../../structures/extra/Permissions';
import type { import type {
APIChannel, APIChannel,

View File

@ -14,8 +14,8 @@ import {
type AllChannels, type AllChannels,
BaseChannel, BaseChannel,
type CreateStickerBodyRequest, type CreateStickerBodyRequest,
type GuildChannelTypes,
channelFrom, channelFrom,
type GuildChannelTypes,
} from '../../structures'; } from '../../structures';
import type { import type {
APIChannel, APIChannel,

View File

@ -1,4 +1,7 @@
import type { ValidAnswerId } from '../../api/Routes/channels';
import { resolveFiles } from '../../builders'; import { resolveFiles } from '../../builders';
import { CacheFrom } from '../../cache';
import { type MessageStructure, type ThreadChannelStructure, Transformers, type UserStructure } from '../../client';
import { MessagesMethods } from '../../structures'; import { MessagesMethods } from '../../structures';
import type { import type {
RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesQuery,
@ -6,10 +9,6 @@ import type {
RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageJSONBody,
RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsJSONBody,
} from '../../types'; } from '../../types';
import type { ValidAnswerId } from '../../api/Routes/channels';
import { CacheFrom } from '../../cache';
import { type MessageStructure, type ThreadChannelStructure, Transformers, type UserStructure } from '../../client';
import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../types/write'; import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../types/write';
import { BaseShorter } from './base'; import { BaseShorter } from './base';

View File

@ -1,9 +1,9 @@
import { resolveFiles } from '../../builders'; import { resolveFiles } from '../../builders';
import { Transformers, type WebhookMessageStructure, type WebhookStructure } from '../../client/transformers'; import { Transformers, type WebhookMessageStructure, type WebhookStructure } from '../../client/transformers';
import { import {
MessagesMethods,
type MessageWebhookMethodEditParams, type MessageWebhookMethodEditParams,
type MessageWebhookMethodWriteParams, type MessageWebhookMethodWriteParams,
MessagesMethods,
} from '../../structures'; } from '../../structures';
import type { import type {
APIWebhook, APIWebhook,

View File

@ -1,6 +1,6 @@
import type { Identify } from '..';
import type { CDNUrlOptions } from '../../api'; import type { CDNUrlOptions } from '../../api';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import type { Identify } from '..';
export type ImageOptions = CDNUrlOptions; export type ImageOptions = CDNUrlOptions;

View File

@ -1,7 +1,7 @@
import type { EmbedColors, OmitInsert } from '..';
import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders'; import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders';
import type { GuildMember } from '../../structures'; import type { GuildMember } from '../../structures';
import type { APIGuildMember, APIPartialEmoji, RESTPostAPIApplicationEmojiJSONBody } from '../../types'; import type { APIGuildMember, APIPartialEmoji, RESTPostAPIApplicationEmojiJSONBody } from '../../types';
import type { EmbedColors, OmitInsert } from '..';
export type EmojiResolvable = string | Partial<APIPartialEmoji> | `<${string | undefined}:${string}:${string}>`; export type EmojiResolvable = string | Partial<APIPartialEmoji> | `<${string | undefined}:${string}:${string}>`;
export type GuildMemberResolvable = string | Partial<GuildMember> | APIGuildMember; export type GuildMemberResolvable = string | Partial<GuildMember> | APIGuildMember;

View File

@ -171,14 +171,10 @@ type OptionalizeAux<T extends object> = Identify<
* it is recursive * it is recursive
*/ */
export type Optionalize<T> = T extends object export type Optionalize<T> = T extends object
? // biome-ignore lint/style/useShorthandArrayType: typescript things ? T extends Array<unknown>
// biome-ignore lint/style/useConsistentArrayType: <explanation>
T extends Array<unknown>
? number extends T['length'] ? number extends T['length']
? T[number] extends object ? T[number] extends object
? // biome-ignore lint/style/useShorthandArrayType: <explanation> ? Array<OptionalizeAux<T[number]>>
// biome-ignore lint/style/useConsistentArrayType: <explanation>
Array<OptionalizeAux<T[number]>>
: T : T
: Partial<T> : Partial<T>
: OptionalizeAux<T> : OptionalizeAux<T>

View File

@ -4,6 +4,7 @@ import {
type ChannelSelectMenu, type ChannelSelectMenu,
type Container, type Container,
type File, type File,
fromComponent,
type MediaGallery, type MediaGallery,
type MentionableSelectMenu, type MentionableSelectMenu,
type RoleSelectMenu, type RoleSelectMenu,
@ -14,7 +15,6 @@ import {
type TextInput, type TextInput,
type Thumbnail, type Thumbnail,
type UserSelectMenu, type UserSelectMenu,
fromComponent,
} from '../builders'; } from '../builders';
import { import {
type APIActionRowComponent, type APIActionRowComponent,

View File

@ -1,5 +1,5 @@
import { type ContainerComponents, componentFactory } from '.';
import type { APIContainerComponent, ComponentType } from '../types'; import type { APIContainerComponent, ComponentType } from '../types';
import { type ContainerComponents, componentFactory } from '.';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';
export class ContainerComponent extends BaseComponent<ComponentType.Container> { export class ContainerComponent extends BaseComponent<ComponentType.Container> {

View File

@ -1,5 +1,5 @@
import { componentFactory } from '.';
import type { APISectionComponent, ComponentType } from '../types'; import type { APISectionComponent, ComponentType } from '../types';
import { componentFactory } from '.';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';
import type { ButtonComponent } from './ButtonComponent'; import type { ButtonComponent } from './ButtonComponent';
import type { TextDisplayComponent } from './TextDisplay'; import type { TextDisplayComponent } from './TextDisplay';

View File

@ -9,7 +9,7 @@ import type {
import { LimitedCollection } from '../collection'; import { LimitedCollection } from '../collection';
import { BaseCommand, type RegisteredMiddlewares, type UsingClient } from '../commands'; import { BaseCommand, type RegisteredMiddlewares, type UsingClient } from '../commands';
import type { FileLoaded } from '../commands/handler'; import type { FileLoaded } from '../commands/handler';
import { BaseHandler, type Logger, type OnFailCallback, isCloudfareWorker, magicImport } from '../common'; import { BaseHandler, isCloudfareWorker, type Logger, magicImport, type OnFailCallback } from '../common';
import type { ComponentInteraction, ModalSubmitInteraction, StringSelectMenuInteraction } from '../structures'; import type { ComponentInteraction, ModalSubmitInteraction, StringSelectMenuInteraction } from '../structures';
import { ComponentCommand, InteractionCommandType } from './componentcommand'; import { ComponentCommand, InteractionCommandType } from './componentcommand';
import type { ComponentContext } from './componentcontext'; import type { ComponentContext } from './componentcontext';

View File

@ -4,11 +4,11 @@ import type { FileLoaded } from '../commands/handler';
import { import {
BaseHandler, BaseHandler,
type CamelCase, type CamelCase,
isCloudfareWorker,
type MakeRequired, type MakeRequired,
magicImport,
ReplaceRegex, ReplaceRegex,
type SnakeCase, type SnakeCase,
isCloudfareWorker,
magicImport,
} from '../common'; } from '../common';
import type { ClientEvents } from '../events/hooks'; import type { ClientEvents } from '../events/hooks';
import * as RawEvents from '../events/hooks'; import * as RawEvents from '../events/hooks';

View File

@ -1,3 +1,6 @@
import type { UsingClient } from '../../commands';
import { toCamelCase } from '../../common';
import { type AllChannels, channelFrom } from '../../structures';
import type { import type {
GatewayChannelCreateDispatchData, GatewayChannelCreateDispatchData,
GatewayChannelDeleteDispatchData, GatewayChannelDeleteDispatchData,
@ -5,10 +8,6 @@ import type {
GatewayChannelUpdateDispatchData, GatewayChannelUpdateDispatchData,
} from '../../types'; } from '../../types';
import type { UsingClient } from '../../commands';
import { toCamelCase } from '../../common';
import { type AllChannels, channelFrom } from '../../structures';
export const CHANNEL_CREATE = (self: UsingClient, data: GatewayChannelCreateDispatchData): AllChannels => { export const CHANNEL_CREATE = (self: UsingClient, data: GatewayChannelCreateDispatchData): AllChannels => {
return channelFrom(data, self); return channelFrom(data, self);
}; };

View File

@ -20,8 +20,8 @@ import type {
GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData,
GatewayGuildMemberAddDispatchData, GatewayGuildMemberAddDispatchData,
GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberRemoveDispatchData,
GatewayGuildMemberUpdateDispatchData,
GatewayGuildMembersChunkDispatchData, GatewayGuildMembersChunkDispatchData,
GatewayGuildMemberUpdateDispatchData,
GatewayGuildRoleCreateDispatchData, GatewayGuildRoleCreateDispatchData,
GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleDeleteDispatchData,
GatewayGuildRoleUpdateDispatchData, GatewayGuildRoleUpdateDispatchData,

View File

@ -10,13 +10,13 @@ export * from './interactions';
export * from './invite'; export * from './invite';
export * from './message'; export * from './message';
export * from './presence'; export * from './presence';
export * from './soundboard';
export * from './stage'; export * from './stage';
export * from './thread'; export * from './thread';
export * from './typing'; export * from './typing';
export * from './user'; export * from './user';
export * from './voice'; export * from './voice';
export * from './webhook'; export * from './webhook';
export * from './soundboard';
import type { CamelCase } from '../../common'; import type { CamelCase } from '../../common';
import type * as RawEvents from './index'; import type * as RawEvents from './index';

View File

@ -1,6 +1,6 @@
import { type MessageStructure, Transformers } from '../../client/transformers'; import { type MessageStructure, Transformers } from '../../client/transformers';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { type ObjectToLower, type OmitInsert, fakePromise, toCamelCase } from '../../common'; import { fakePromise, type ObjectToLower, type OmitInsert, toCamelCase } from '../../common';
import type { import type {
GatewayMessageCreateDispatchData, GatewayMessageCreateDispatchData,
GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteBulkDispatchData,

View File

@ -5,8 +5,8 @@ import type {
APISoundBoard, APISoundBoard,
GatewayGuildSoundboardSoundCreateDispatchData, GatewayGuildSoundboardSoundCreateDispatchData,
GatewayGuildSoundboardSoundDeleteDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData,
GatewayGuildSoundboardSoundUpdateDispatchData,
GatewayGuildSoundboardSoundsUpdateDispatchData, GatewayGuildSoundboardSoundsUpdateDispatchData,
GatewayGuildSoundboardSoundUpdateDispatchData,
GatewaySoundboardSoundsDispatchData, GatewaySoundboardSoundsDispatchData,
} from '../../types'; } from '../../types';

View File

@ -5,8 +5,8 @@ import type {
GatewayThreadCreateDispatchData, GatewayThreadCreateDispatchData,
GatewayThreadDeleteDispatchData, GatewayThreadDeleteDispatchData,
GatewayThreadListSyncDispatchData, GatewayThreadListSyncDispatchData,
GatewayThreadMemberUpdateDispatchData,
GatewayThreadMembersUpdateDispatchData, GatewayThreadMembersUpdateDispatchData,
GatewayThreadMemberUpdateDispatchData,
GatewayThreadUpdateDispatchData, GatewayThreadUpdateDispatchData,
} from '../../types'; } from '../../types';

View File

@ -1,4 +1,5 @@
export * from './client'; export * from './client';
import { import {
BaseClient, BaseClient,
type BaseClientOptions, type BaseClientOptions,
@ -10,21 +11,22 @@ import {
import { isCloudfareWorker } from './common'; import { isCloudfareWorker } from './common';
import type { ClientNameEvents, CustomEventsKeys, ResolveEventParams } from './events'; import type { ClientNameEvents, CustomEventsKeys, ResolveEventParams } from './events';
import { GatewayIntentBits } from './types'; import { GatewayIntentBits } from './types';
export { Logger, PermissionStrings, Formatter } from './common';
//
export { Collection, LimitedCollection } from './collection';
// //
export * from './api'; export * from './api';
export * from './builders'; export * from './builders';
export * from './cache'; export * from './cache';
//
export { Collection, LimitedCollection } from './collection';
export * from './commands'; export * from './commands';
export { Formatter, Logger, PermissionStrings } from './common';
export * from './components'; export * from './components';
export * from './events'; export * from './events';
export * from './langs'; export * from './langs';
// //
export { ShardManager, WorkerManager } from './websocket/discord';
//
export * from './structures'; export * from './structures';
//
export { ShardManager, WorkerManager } from './websocket/discord';
/** /**
* Creates an event with the specified data and run function. * Creates an event with the specified data and run function.

View File

@ -4,15 +4,15 @@ import type { CreateInviteFromChannel } from '../common';
import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util'; import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util';
import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, RESTPatchAPIGuildJSONBody } from '../types'; import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, RESTPatchAPIGuildJSONBody } from '../types';
import { AutoModerationRule } from './AutoModerationRule'; import { AutoModerationRule } from './AutoModerationRule';
import { BaseChannel, WebhookGuildMethods } from './channels';
import { GuildEmoji } from './Emoji'; import { GuildEmoji } from './Emoji';
import { BaseGuild } from './extra/BaseGuild';
import type { DiscordBase } from './extra/DiscordBase';
import { GuildBan } from './GuildBan'; import { GuildBan } from './GuildBan';
import { GuildMember } from './GuildMember'; import { GuildMember } from './GuildMember';
import { GuildRole } from './GuildRole'; import { GuildRole } from './GuildRole';
import { GuildTemplate } from './GuildTemplate'; import { GuildTemplate } from './GuildTemplate';
import { Sticker } from './Sticker'; import { Sticker } from './Sticker';
import { BaseChannel, WebhookGuildMethods } from './channels';
import { BaseGuild } from './extra/BaseGuild';
import type { DiscordBase } from './extra/DiscordBase';
export interface Guild extends ObjectToLower<Omit<APIGuild, 'stickers' | 'emojis' | 'roles'>>, DiscordBase {} export interface Guild extends ObjectToLower<Omit<APIGuild, 'stickers' | 'emojis' | 'roles'>>, DiscordBase {}
export class Guild<State extends StructStates = 'api'> extends (BaseGuild as unknown as ToClass< export class Guild<State extends StructStates = 'api'> extends (BaseGuild as unknown as ToClass<

View File

@ -3,7 +3,7 @@ import type { GuildBanStructure, GuildStructure } from '../client';
import type { UsingClient } from '../commands'; import type { UsingClient } from '../commands';
import { Formatter, type MethodContext, type ObjectToLower } from '../common'; import { Formatter, type MethodContext, type ObjectToLower } from '../common';
import type { BanShorter } from '../common/shorters/bans'; import type { BanShorter } from '../common/shorters/bans';
import type { APIBan, ActuallyBan, RESTGetAPIGuildBansQuery } from '../types'; import type { ActuallyBan, APIBan, RESTGetAPIGuildBansQuery } from '../types';
import { DiscordBase } from './extra/DiscordBase'; import { DiscordBase } from './extra/DiscordBase';
export interface GuildBan extends DiscordBase, ObjectToLower<Omit<APIBan, 'id'>> {} export interface GuildBan extends DiscordBase, ObjectToLower<Omit<APIBan, 'id'>> {}

View File

@ -1,3 +1,33 @@
import type { RawFile } from '../api';
import { ActionRow, Embed, Modal, PollBuilder, resolveAttachment, resolveFiles } from '../builders';
import type { ReturnCache } from '../cache';
import {
type EntitlementStructure,
type GuildRoleStructure,
type GuildStructure,
type InteractionGuildMemberStructure,
type MessageStructure,
type OptionResolverStructure,
Transformers,
type UserStructure,
type WebhookMessageStructure,
} from '../client/transformers';
import type { ContextOptionsResolved, UsingClient } from '../commands';
import {
type ComponentInteractionMessageUpdate,
type InteractionCreateBodyRequest,
type InteractionMessageUpdateBodyRequest,
type MessageCreateBodyRequest,
type MessageUpdateBodyRequest,
type MessageWebhookCreateBodyRequest,
type ModalCreateBodyRequest,
type ObjectToLower,
type OmitInsert,
type ToClass,
toCamelCase,
type When,
} from '../common';
import { mix } from '../deps/mixer';
import { import {
type APIActionRowComponent, type APIActionRowComponent,
type APIApplicationCommandAutocompleteInteraction, type APIApplicationCommandAutocompleteInteraction,
@ -41,37 +71,6 @@ import {
type RESTPostAPIInteractionCallbackJSONBody, type RESTPostAPIInteractionCallbackJSONBody,
type RESTPostAPIInteractionCallbackResult, type RESTPostAPIInteractionCallbackResult,
} from '../types'; } from '../types';
import type { RawFile } from '../api';
import { ActionRow, Embed, Modal, PollBuilder, resolveAttachment, resolveFiles } from '../builders';
import type { ReturnCache } from '../cache';
import {
type EntitlementStructure,
type GuildRoleStructure,
type GuildStructure,
type InteractionGuildMemberStructure,
type MessageStructure,
type OptionResolverStructure,
Transformers,
type UserStructure,
type WebhookMessageStructure,
} from '../client/transformers';
import type { ContextOptionsResolved, UsingClient } from '../commands';
import {
type ComponentInteractionMessageUpdate,
type InteractionCreateBodyRequest,
type InteractionMessageUpdateBodyRequest,
type MessageCreateBodyRequest,
type MessageUpdateBodyRequest,
type MessageWebhookCreateBodyRequest,
type ModalCreateBodyRequest,
type ObjectToLower,
type OmitInsert,
type ToClass,
type When,
toCamelCase,
} from '../common';
import { mix } from '../deps/mixer';
import { type AllChannels, channelFrom } from './'; import { type AllChannels, channelFrom } from './';
import { DiscordBase } from './extra/DiscordBase'; import { DiscordBase } from './extra/DiscordBase';
import { PermissionsBitField } from './extra/Permissions'; import { PermissionsBitField } from './extra/Permissions';
@ -315,7 +314,6 @@ export class BaseInteraction<
switch (gateway.type) { switch (gateway.type) {
case InteractionType.ApplicationCommandAutocomplete: case InteractionType.ApplicationCommandAutocomplete:
return new AutocompleteInteraction(client, gateway, undefined, __reply); return new AutocompleteInteraction(client, gateway, undefined, __reply);
// biome-ignore lint/suspicious/noFallthroughSwitchClause: bad interaction between biome and ts-server
case InteractionType.ApplicationCommand: case InteractionType.ApplicationCommand:
switch (gateway.data.type) { switch (gateway.data.type) {
case ApplicationCommandType.ChatInput: case ApplicationCommandType.ChatInput:

View File

@ -1,4 +1,4 @@
import { type AllChannels, Embed, type ReturnCache, componentFactory } from '..'; import { type AllChannels, componentFactory, Embed, type ReturnCache } from '..';
import type { ListenerOptions } from '../builders'; import type { ListenerOptions } from '../builders';
import { import {
type GuildMemberStructure, type GuildMemberStructure,
@ -11,8 +11,7 @@ import {
type WebhookStructure, type WebhookStructure,
} from '../client/transformers'; } from '../client/transformers';
import type { UsingClient } from '../commands'; import type { UsingClient } from '../commands';
import { type ObjectToLower, toCamelCase } from '../common'; import { Formatter, type ObjectToLower, toCamelCase } from '../common';
import { Formatter } from '../common';
import type { EmojiResolvable } from '../common/types/resolvables'; import type { EmojiResolvable } from '../common/types/resolvables';
import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write'; import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write';
import type { TopLevelComponents } from '../components'; import type { TopLevelComponents } from '../components';
@ -24,8 +23,8 @@ import type {
APIUser, APIUser,
GatewayMessageCreateDispatchData, GatewayMessageCreateDispatchData,
} from '../types'; } from '../types';
import type { MessageWebhookMethodEditParams, MessageWebhookMethodWriteParams } from './Webhook';
import { DiscordBase } from './extra/DiscordBase'; import { DiscordBase } from './extra/DiscordBase';
import type { MessageWebhookMethodEditParams, MessageWebhookMethodWriteParams } from './Webhook';
export type MessageData = APIMessage | GatewayMessageCreateDispatchData; export type MessageData = APIMessage | GatewayMessageCreateDispatchData;

View File

@ -5,8 +5,8 @@ import {
type BaseChannelStructure, type BaseChannelStructure,
type BaseGuildChannelStructure, type BaseGuildChannelStructure,
type CategoryChannelStructure, type CategoryChannelStructure,
type DMChannelStructure,
type DirectoryChannelStructure, type DirectoryChannelStructure,
type DMChannelStructure,
type ForumChannelStructure, type ForumChannelStructure,
type GuildMemberStructure, type GuildMemberStructure,
type GuildStructure, type GuildStructure,
@ -26,13 +26,13 @@ import type { SeyfertChannelMap, UsingClient } from '../commands';
import { import {
type CreateInviteFromChannel, type CreateInviteFromChannel,
type EmojiResolvable, type EmojiResolvable,
fakePromise,
type MessageCreateBodyRequest, type MessageCreateBodyRequest,
type MessageUpdateBodyRequest, type MessageUpdateBodyRequest,
type MethodContext, type MethodContext,
type ObjectToLower, type ObjectToLower,
type StringToNumber, type StringToNumber,
type ToClass, type ToClass,
fakePromise,
} from '../common'; } from '../common';
import { mix } from '../deps/mixer'; import { mix } from '../deps/mixer';
import { import {
@ -63,9 +63,9 @@ import {
type ThreadAutoArchiveDuration, type ThreadAutoArchiveDuration,
VideoQualityMode, VideoQualityMode,
} from '../types'; } from '../types';
import { DiscordBase } from './extra/DiscordBase';
import type { GuildMember } from './GuildMember'; import type { GuildMember } from './GuildMember';
import type { GuildRole } from './GuildRole'; import type { GuildRole } from './GuildRole';
import { DiscordBase } from './extra/DiscordBase';
export class BaseNoEditableChannel<T extends ChannelType> extends DiscordBase<APIChannelBase<ChannelType>> { export class BaseNoEditableChannel<T extends ChannelType> extends DiscordBase<APIChannelBase<ChannelType>> {
declare type: T; declare type: T;

View File

@ -1,6 +1,6 @@
import type { ReturnCache, WorkerClient } from '../..'; import type { ReturnCache, WorkerClient } from '../..';
import type { GuildStructure } from '../../client'; import type { GuildStructure } from '../../client';
import { type ObjectToLower, calculateShardId } from '../../common'; import { calculateShardId, type ObjectToLower } from '../../common';
import type { ImageOptions } from '../../common/types/options'; import type { ImageOptions } from '../../common/types/options';
import { type APIPartialGuild, GuildFeature } from '../../types'; import { type APIPartialGuild, GuildFeature } from '../../types';
import type { ShardManager } from '../../websocket'; import type { ShardManager } from '../../websocket';

View File

@ -1,19 +1,19 @@
export * from './AnonymousGuild'; export * from './AnonymousGuild';
export * from './AutoModerationRule'; export * from './AutoModerationRule';
export * from './ClientUser'; export * from './ClientUser';
export * from './Guild'; export * from './channels';
export * from './Emoji'; export * from './Emoji';
export * from './Entitlement';
export * from './Guild';
export * from './GuildBan';
export * from './GuildMember'; export * from './GuildMember';
export * from './GuildPreview'; export * from './GuildPreview';
export * from './GuildRole'; export * from './GuildRole';
export * from './GuildTemplate'; export * from './GuildTemplate';
export * from './Interaction'; export * from './Interaction';
export * from './Message'; export * from './Message';
export * from './Poll';
export * from './Sticker'; export * from './Sticker';
export * from './User'; export * from './User';
export * from './VoiceState'; export * from './VoiceState';
export * from './Webhook'; export * from './Webhook';
export * from './channels';
export * from './Poll';
export * from './GuildBan';
export * from './Entitlement';

View File

@ -23,9 +23,9 @@
*/ */
export * from './gateway'; export * from './gateway';
export * from './rest';
export * from './payloads'; export * from './payloads';
export * from './rest'; export * from './rest';
export * from './rest';
export * from './utils'; export * from './utils';
/** /**

View File

@ -1,7 +1,6 @@
import type { ApplicationIntegrationType, InteractionContextType } from '..';
import type { ChannelType, Permissions, Snowflake } from '../..'; import type { ChannelType, Permissions, Snowflake } from '../..';
import type { LocaleString } from '../../rest'; import type { LocaleString } from '../../rest';
import type { ApplicationIntegrationType, InteractionContextType } from '..';
import type { import type {
APIAttachment, APIAttachment,
APIChannel, APIChannel,

View File

@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/application * Types extracted from https://discord.com/developers/docs/resources/application
*/ */
import type { APIEmoji, LocalizationMap } from '.';
import type { Permissions, Snowflake } from '..';
import type { MakeRequired } from '../../common'; import type { MakeRequired } from '../../common';
import type { Permissions, Snowflake } from '..';
import type { APIEmoji, LocalizationMap } from '.';
import type { APIPartialGuild } from './guild'; import type { APIPartialGuild } from './guild';
import type { ApplicationIntegrationType } from './interactions'; import type { ApplicationIntegrationType } from './interactions';
import type { OAuth2Scopes } from './oauth2'; import type { OAuth2Scopes } from './oauth2';

View File

@ -1,5 +1,5 @@
import type { APIAttachment, Snowflake } from '..';
import type { Identify, MakeRequired } from '../../common'; import type { Identify, MakeRequired } from '../../common';
import type { APIAttachment, Snowflake } from '..';
import type { ChannelType } from '../utils'; import type { ChannelType } from '../utils';
/** /**

View File

@ -1,6 +1,7 @@
import type { Snowflake } from '..'; import type { Snowflake } from '..';
import type { APIGuildMember } from './guild'; import type { APIGuildMember } from './guild';
import type { APIUser } from './user'; import type { APIUser } from './user';
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> { interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/** /**
* The id of the guild event * The id of the guild event

View File

@ -2,15 +2,18 @@ export * from './application';
export * from './auditLog'; export * from './auditLog';
export * from './autoModeration'; export * from './autoModeration';
export * from './channel'; export * from './channel';
export * from './components';
export * from './emoji'; export * from './emoji';
export * from './gateway'; export * from './gateway';
export * from './guild'; export * from './guild';
export * from './guildScheduledEvent'; export * from './guildScheduledEvent';
export * from './interactions'; export * from './interactions';
export * from './invite'; export * from './invite';
export * from './monetization';
export * from './oauth2'; export * from './oauth2';
export * from './poll';
export * from './permissions'; export * from './permissions';
export * from './poll';
export * from './soundboard';
export * from './stageInstance'; export * from './stageInstance';
export * from './sticker'; export * from './sticker';
export * from './teams'; export * from './teams';
@ -18,9 +21,6 @@ export * from './template';
export * from './user'; export * from './user';
export * from './voice'; export * from './voice';
export * from './webhook'; export * from './webhook';
export * from './monetization';
export * from './soundboard';
export * from './components';
import type { LocaleString } from '../rest'; import type { LocaleString } from '../rest';

View File

@ -10,16 +10,16 @@ export * from './guild';
export * from './guildScheduledEvent'; export * from './guildScheduledEvent';
export * from './interactions'; export * from './interactions';
export * from './invite'; export * from './invite';
export * from './monetization';
export * from './oauth2'; export * from './oauth2';
export * from './poll'; export * from './poll';
export * from './soundboard';
export * from './stageInstance'; export * from './stageInstance';
export * from './sticker'; export * from './sticker';
export * from './template'; export * from './template';
export * from './user'; export * from './user';
export * from './voice'; export * from './voice';
export * from './webhook'; export * from './webhook';
export * from './monetization';
export * from './soundboard';
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5; export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

View File

@ -23,8 +23,8 @@ import type {
GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData,
GatewayGuildMemberAddDispatchData, GatewayGuildMemberAddDispatchData,
GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberRemoveDispatchData,
GatewayGuildMemberUpdateDispatchData,
GatewayGuildMembersChunkDispatchData, GatewayGuildMembersChunkDispatchData,
GatewayGuildMemberUpdateDispatchData,
GatewayGuildRoleCreateDispatchData, GatewayGuildRoleCreateDispatchData,
GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleDeleteDispatchData,
GatewayGuildRoleUpdateDispatchData, GatewayGuildRoleUpdateDispatchData,
@ -55,8 +55,8 @@ import type {
GatewayThreadCreateDispatchData, GatewayThreadCreateDispatchData,
GatewayThreadDeleteDispatchData, GatewayThreadDeleteDispatchData,
GatewayThreadListSyncDispatchData, GatewayThreadListSyncDispatchData,
GatewayThreadMemberUpdateDispatchData,
GatewayThreadMembersUpdateDispatchData, GatewayThreadMembersUpdateDispatchData,
GatewayThreadMemberUpdateDispatchData,
GatewayTypingStartDispatchData, GatewayTypingStartDispatchData,
GatewayUserUpdateDispatchData, GatewayUserUpdateDispatchData,
GatewayVoiceChannelEffectSendDispachData, GatewayVoiceChannelEffectSendDispachData,

View File

@ -1,5 +1,5 @@
import { inflateSync } from 'node:zlib'; import { inflateSync } from 'node:zlib';
import { LogLevels, Logger, type MakeRequired, MergeOptions, delay, hasIntent } from '../../common'; import { delay, hasIntent, Logger, LogLevels, type MakeRequired, MergeOptions } from '../../common';
import { import {
type APIGuildMember, type APIGuildMember,
GatewayCloseCodes, GatewayCloseCodes,
@ -56,10 +56,7 @@ export class Shard {
{ {
members: APIGuildMember[]; members: APIGuildMember[];
presences: GatewayGuildMembersChunkPresence[]; presences: GatewayGuildMembersChunkPresence[];
resolve: (value: { resolve: (value: { members: APIGuildMember[]; presences: GatewayGuildMembersChunkPresence[] }) => void;
members: APIGuildMember[];
presences: GatewayGuildMembersChunkPresence[];
}) => void;
reject: (reason?: any) => void; reject: (reason?: any) => void;
} }
>(); >();
@ -138,7 +135,6 @@ export class Shard {
); );
// @ts-expect-error Use native websocket when using Bun // @ts-expect-error Use native websocket when using Bun
// biome-ignore lint/correctness/noUndeclaredVariables: /\
this.websocket = new BaseSocket(typeof Bun === 'undefined' ? 'ws' : 'bun', this.currentGatewayURL); this.websocket = new BaseSocket(typeof Bun === 'undefined' ? 'ws' : 'bun', this.currentGatewayURL);
this.websocket.onmessage = ({ data }: { data: string | Buffer }) => { this.websocket.onmessage = ({ data }: { data: string | Buffer }) => {
@ -374,10 +370,7 @@ export class Shard {
) { ) {
const nonce = Date.now().toString() + Math.random().toString(36); const nonce = Date.now().toString() + Math.random().toString(36);
let resolve: (value: { let resolve: (value: { members: APIGuildMember[]; presences: GatewayGuildMembersChunkPresence[] }) => void = () => {
members: APIGuildMember[];
presences: GatewayGuildMembersChunkPresence[];
}) => void = () => {
// //
}; };
let reject: (reason?: any) => void = () => { let reject: (reason?: any) => void = () => {

View File

@ -1,11 +1,11 @@
import { import {
LogLevels, calculateShardId,
Logger, Logger,
LogLevels,
lazyLoadPackage,
type MakeRequired, type MakeRequired,
MergeOptions, MergeOptions,
type WatcherSendToShard, type WatcherSendToShard,
calculateShardId,
lazyLoadPackage,
} from '../../common'; } from '../../common';
import type { DeepPartial, MakeDeepPartial } from '../../common/types/util'; import type { DeepPartial, MakeDeepPartial } from '../../common/types/util';
import { import {

View File

@ -1,4 +1,4 @@
import { type UUID, createHash, randomBytes, randomUUID } from 'node:crypto'; import { createHash, randomBytes, randomUUID, type UUID } from 'node:crypto';
import { request } from 'node:https'; import { request } from 'node:https';
import type { Socket } from 'node:net'; import type { Socket } from 'node:net';

View File

@ -1,12 +1,12 @@
import cluster, { type Worker as ClusterWorker } from 'node:cluster'; import cluster, { type Worker as ClusterWorker } from 'node:cluster';
import { type UUID, randomUUID } from 'node:crypto'; import { randomUUID, type UUID } from 'node:crypto';
import type { Worker as WorkerThreadsWorker } from 'node:worker_threads'; import type { Worker as WorkerThreadsWorker } from 'node:worker_threads';
import { ApiHandler, type CustomWorkerManagerEvents, Logger, type UsingClient, type WorkerClient } from '../..'; import { ApiHandler, type CustomWorkerManagerEvents, Logger, type UsingClient, type WorkerClient } from '../..';
import { type Adapter, MemoryAdapter } from '../../cache'; import { type Adapter, MemoryAdapter } from '../../cache';
import { BaseClient, type InternalRuntimeConfig } from '../../client/base'; import { BaseClient, type InternalRuntimeConfig } from '../../client/base';
import { BASE_HOST, type Identify, MergeOptions, type PickPartial, lazyLoadPackage } from '../../common'; import { BASE_HOST, type Identify, lazyLoadPackage, MergeOptions, type PickPartial } from '../../common';
import type { GatewayPresenceUpdateData, GatewaySendPayload, RESTGetAPIGatewayBotResult } from '../../types'; import type { GatewayPresenceUpdateData, GatewaySendPayload, RESTGetAPIGatewayBotResult } from '../../types';
import { WorkerManagerDefaults, properties } from '../constants'; import { properties, WorkerManagerDefaults } from '../constants';
import { DynamicBucket } from '../structures'; import { DynamicBucket } from '../structures';
import { ConnectQueue } from '../structures/timeout'; import { ConnectQueue } from '../structures/timeout';
import { Heartbeater, type WorkerHeartbeaterMessages } from './heartbeater'; import { Heartbeater, type WorkerHeartbeaterMessages } from './heartbeater';

View File

@ -1,3 +1,3 @@
export * from './SharedTypes';
export * from './constants'; export * from './constants';
export * from './discord'; export * from './discord';
export * from './SharedTypes';

View File

@ -1,4 +1,4 @@
import { type Logger, delay } from '../../common'; import { delay, type Logger } from '../../common';
/** /**
* options of the dynamic bucket * options of the dynamic bucket