feat: Reduce dependencies (#221)

* feat: add support for new Discord application emojis features

* feat: add support for new Discord application emojis features

* feat: applications emojis routes

* chore: switch typings provider

* fix: unnecesary type

* feat: magic bytes

* chore: move api-types

* chore: ?

* fix: omg npm

* chore: apply formatting

* fix: for fast merge

---------

Co-authored-by: Tony Supremacy <165050835+VanStk@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Marcos Susaña 2024-07-21 22:58:40 -04:00 committed by GitHub
parent 04e17789e8
commit bd951397a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
206 changed files with 15038 additions and 361 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@ node_modules
lib/ lib/
dist/ dist/
__test__ __test__
package-lock.json

View File

@ -28,7 +28,8 @@
"noDefaultExport": "off", "noDefaultExport": "off",
"noNamespaceImport": "off", "noNamespaceImport": "off",
"useSingleCaseStatement": "off", "useSingleCaseStatement": "off",
"useBlockStatements": "off" "useBlockStatements": "off",
"useEnumInitializers": "off"
}, },
"correctness": { "correctness": {
"noUnusedVariables": "off", "noUnusedVariables": "off",

View File

@ -6,7 +6,8 @@
"module": "./lib/index.js", "module": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"files": [ "files": [
"lib/**" "lib/**",
"deps/**"
], ],
"scripts": { "scripts": {
"build": "tsc --outDir ./lib", "build": "tsc --outDir ./lib",
@ -20,7 +21,6 @@
"author": "MARCROCK22", "author": "MARCROCK22",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"discord-api-types": "github:tiramisulabs/discord-api-types",
"magic-bytes.js": "^1.10.0", "magic-bytes.js": "^1.10.0",
"ts-mixer": "^6.0.4", "ts-mixer": "^6.0.4",
"ws": "^8.18.0" "ws": "^8.18.0"
@ -31,7 +31,7 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "1.8.1", "@biomejs/biome": "1.8.3",
"@commitlint/cli": "^19.3.0", "@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2", "@commitlint/config-conventional": "^19.2.2",
"@types/node": "^20.14.11", "@types/node": "^20.14.11",
@ -64,10 +64,20 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"contributors": [ "maintainers": [
{ {
"name": "socram03", "name": "socram03",
"url": "https://github.com/socram03" "url": "https://github.com/socram03"
} }
],
"contributors": [
{
"name": "Free 公園",
"url": "https://github.com/FreeAoi"
},
{
"name": "David",
"url": "https://github.com/Drylozu"
}
] ]
} }

83
pnpm-lock.yaml generated
View File

@ -8,9 +8,6 @@ importers:
.: .:
dependencies: dependencies:
discord-api-types:
specifier: github:tiramisulabs/discord-api-types
version: https://codeload.github.com/tiramisulabs/discord-api-types/tar.gz/fb7d551a671718f4e1b7b4010574c0f3a4d0a858
magic-bytes.js: magic-bytes.js:
specifier: ^1.10.0 specifier: ^1.10.0
version: 1.10.0 version: 1.10.0
@ -35,8 +32,8 @@ importers:
version: https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/f40213ec0a97d0d8721d9d32d92d6eb6ddcd22e7 version: https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/f40213ec0a97d0d8721d9d32d92d6eb6ddcd22e7
devDependencies: devDependencies:
'@biomejs/biome': '@biomejs/biome':
specifier: 1.8.1 specifier: 1.8.3
version: 1.8.1 version: 1.8.3
'@commitlint/cli': '@commitlint/cli':
specifier: ^19.3.0 specifier: ^19.3.0
version: 19.3.0(@types/node@20.14.11)(typescript@5.5.3) version: 19.3.0(@types/node@20.14.11)(typescript@5.5.3)
@ -73,55 +70,55 @@ packages:
resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
'@biomejs/biome@1.8.1': '@biomejs/biome@1.8.3':
resolution: {integrity: sha512-fQXGfvq6DIXem12dGQCM2tNF+vsNHH1qs3C7WeOu75Pd0trduoTmoO7G4ntLJ2qDs5wuw981H+cxQhi1uHnAtA==} resolution: {integrity: sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
hasBin: true hasBin: true
'@biomejs/cli-darwin-arm64@1.8.1': '@biomejs/cli-darwin-arm64@1.8.3':
resolution: {integrity: sha512-XLiB7Uu6GALIOBWzQ2aMD0ru4Ly5/qSeQF7kk3AabzJ/kwsEWSe33iVySBP/SS2qv25cgqNiLksjGcw2bHT3mw==} resolution: {integrity: sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@biomejs/cli-darwin-x64@1.8.1': '@biomejs/cli-darwin-x64@1.8.3':
resolution: {integrity: sha512-uMTSxVLMfqkBVqyc25hSn83jBbp+wtWjzM/pHFlKXt3htJuw7FErVGW0nmQ9Sxa9vJ7GcqoltLMl28VQRIMYzg==} resolution: {integrity: sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@biomejs/cli-linux-arm64-musl@1.8.1': '@biomejs/cli-linux-arm64-musl@1.8.3':
resolution: {integrity: sha512-UQ8Wc01J0wQL+5AYOc7qkJn20B4PZmQL1KrmDZh7ot0DvD6aX4+8mmfd/dG5b6Zjo/44QvCKcvkFGCMRYuhWZA==} resolution: {integrity: sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@biomejs/cli-linux-arm64@1.8.1': '@biomejs/cli-linux-arm64@1.8.3':
resolution: {integrity: sha512-3SzZRuC/9Oi2P2IBNPsEj0KXxSXUEYRR2kfRF/Ve8QAfGgrt4qnwuWd6QQKKN5R+oYH691qjm+cXBKEcrP1v/Q==} resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@biomejs/cli-linux-x64-musl@1.8.1': '@biomejs/cli-linux-x64-musl@1.8.3':
resolution: {integrity: sha512-fYbP/kNu/rtZ4kKzWVocIdqZOtBSUEg9qUhZaao3dy3CRzafR6u6KDtBeSCnt47O+iLnks1eOR1TUxzr5+QuqA==} resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@biomejs/cli-linux-x64@1.8.1': '@biomejs/cli-linux-x64@1.8.3':
resolution: {integrity: sha512-AeBycVdNrTzsyYKEOtR2R0Ph0hCD0sCshcp2aOnfGP0hCZbtFg09D0SdKLbyzKntisY41HxKVrydYiaApp+2uw==} resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@biomejs/cli-win32-arm64@1.8.1': '@biomejs/cli-win32-arm64@1.8.3':
resolution: {integrity: sha512-6tEd1H/iFKpgpE3OIB7oNgW5XkjiVMzMRPL8zYoZ036YfuJ5nMYm9eB9H/y81+8Z76vL48fiYzMPotJwukGPqQ==} resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
'@biomejs/cli-win32-x64@1.8.1': '@biomejs/cli-win32-x64@1.8.3':
resolution: {integrity: sha512-g2H31jJzYmS4jkvl6TiyEjEX+Nv79a5km/xn+5DARTp5MBFzC9gwceusSSB2AkJKqZzY131AiACAWjKrVt5Ijw==} resolution: {integrity: sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==}
engines: {node: '>=14.21.3'} engines: {node: '>=14.21.3'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
@ -362,10 +359,6 @@ packages:
resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==}
engines: {node: '>=0.10'} engines: {node: '>=0.10'}
discord-api-types@https://codeload.github.com/tiramisulabs/discord-api-types/tar.gz/fb7d551a671718f4e1b7b4010574c0f3a4d0a858:
resolution: {tarball: https://codeload.github.com/tiramisulabs/discord-api-types/tar.gz/fb7d551a671718f4e1b7b4010574c0f3a4d0a858}
version: 0.37.92
dot-prop@5.3.0: dot-prop@5.3.0:
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
engines: {node: '>=8'} engines: {node: '>=8'}
@ -871,39 +864,39 @@ snapshots:
js-tokens: 4.0.0 js-tokens: 4.0.0
picocolors: 1.0.1 picocolors: 1.0.1
'@biomejs/biome@1.8.1': '@biomejs/biome@1.8.3':
optionalDependencies: optionalDependencies:
'@biomejs/cli-darwin-arm64': 1.8.1 '@biomejs/cli-darwin-arm64': 1.8.3
'@biomejs/cli-darwin-x64': 1.8.1 '@biomejs/cli-darwin-x64': 1.8.3
'@biomejs/cli-linux-arm64': 1.8.1 '@biomejs/cli-linux-arm64': 1.8.3
'@biomejs/cli-linux-arm64-musl': 1.8.1 '@biomejs/cli-linux-arm64-musl': 1.8.3
'@biomejs/cli-linux-x64': 1.8.1 '@biomejs/cli-linux-x64': 1.8.3
'@biomejs/cli-linux-x64-musl': 1.8.1 '@biomejs/cli-linux-x64-musl': 1.8.3
'@biomejs/cli-win32-arm64': 1.8.1 '@biomejs/cli-win32-arm64': 1.8.3
'@biomejs/cli-win32-x64': 1.8.1 '@biomejs/cli-win32-x64': 1.8.3
'@biomejs/cli-darwin-arm64@1.8.1': '@biomejs/cli-darwin-arm64@1.8.3':
optional: true optional: true
'@biomejs/cli-darwin-x64@1.8.1': '@biomejs/cli-darwin-x64@1.8.3':
optional: true optional: true
'@biomejs/cli-linux-arm64-musl@1.8.1': '@biomejs/cli-linux-arm64-musl@1.8.3':
optional: true optional: true
'@biomejs/cli-linux-arm64@1.8.1': '@biomejs/cli-linux-arm64@1.8.3':
optional: true optional: true
'@biomejs/cli-linux-x64-musl@1.8.1': '@biomejs/cli-linux-x64-musl@1.8.3':
optional: true optional: true
'@biomejs/cli-linux-x64@1.8.1': '@biomejs/cli-linux-x64@1.8.3':
optional: true optional: true
'@biomejs/cli-win32-arm64@1.8.1': '@biomejs/cli-win32-arm64@1.8.3':
optional: true optional: true
'@biomejs/cli-win32-x64@1.8.1': '@biomejs/cli-win32-x64@1.8.3':
optional: true optional: true
'@commitlint/cli@19.3.0(@types/node@20.14.11)(typescript@5.5.3)': '@commitlint/cli@19.3.0(@types/node@20.14.11)(typescript@5.5.3)':
@ -1185,8 +1178,6 @@ snapshots:
denque@2.1.0: denque@2.1.0:
optional: true optional: true
discord-api-types@https://codeload.github.com/tiramisulabs/discord-api-types/tar.gz/fb7d551a671718f4e1b7b4010574c0f3a4d0a858: {}
dot-prop@5.3.0: dot-prop@5.3.0:
dependencies: dependencies:
is-obj: 2.0.0 is-obj: 2.0.0

View File

@ -30,7 +30,8 @@ import type {
RESTPostAPIApplicationEmojiResult, RESTPostAPIApplicationEmojiResult,
RESTPatchAPIApplicationEmojiResult, RESTPatchAPIApplicationEmojiResult,
RESTDeleteAPIApplicationEmojiResult, RESTDeleteAPIApplicationEmojiResult,
} from 'discord-api-types/v10'; } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -55,7 +55,7 @@ import type {
RESTPutAPIChannelRecipientJSONBody, RESTPutAPIChannelRecipientJSONBody,
RESTPutAPIChannelRecipientResult, RESTPutAPIChannelRecipientResult,
RESTPutAPIChannelThreadMembersResult, RESTPutAPIChannelThreadMembersResult,
} from 'discord-api-types/v10'; } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -1,4 +1,4 @@
import type { RESTGetAPIGatewayBotResult, RESTGetAPIGatewayResult } from 'discord-api-types/v10'; import type { RESTGetAPIGatewayBotResult, RESTGetAPIGatewayResult } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -112,7 +112,7 @@ import type {
RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberResult,
RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildMemberRoleResult,
RESTPutAPIGuildTemplateSyncResult, RESTPutAPIGuildTemplateSyncResult,
} from 'discord-api-types/v10'; } from '../../types';
import type { Identify, OmitInsert } from '../../common'; import type { Identify, OmitInsert } from '../../common';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -1,4 +1,4 @@
import type { RESTPostAPIInteractionCallbackJSONBody } from 'discord-api-types/v10'; import type { RESTPostAPIInteractionCallbackJSONBody } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -1,4 +1,4 @@
import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from 'discord-api-types/v10'; import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -5,7 +5,7 @@ import type {
RESTPatchAPIStageInstanceResult, RESTPatchAPIStageInstanceResult,
RESTPostAPIStageInstanceJSONBody, RESTPostAPIStageInstanceJSONBody,
RESTPostAPIStageInstanceResult, RESTPostAPIStageInstanceResult,
} from 'discord-api-types/v10'; } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -1,4 +1,4 @@
import type { RESTGetAPIStickerResult, RESTGetNitroStickerPacksResult } from 'discord-api-types/v10'; import type { RESTGetAPIStickerResult, RESTGetNitroStickerPacksResult } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -13,7 +13,7 @@ import type {
RESTPostAPICurrentUserCreateDMChannelJSONBody, RESTPostAPICurrentUserCreateDMChannelJSONBody,
RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody,
RESTPutAPICurrentUserApplicationRoleConnectionResult, RESTPutAPICurrentUserApplicationRoleConnectionResult,
} from 'discord-api-types/v10'; } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -1,4 +1,4 @@
import type { RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10'; import type { RESTGetAPIVoiceRegionsResult } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -21,7 +21,7 @@ import type {
RESTPostAPIWebhookWithTokenSlackResult, RESTPostAPIWebhookWithTokenSlackResult,
RESTPostAPIWebhookWithTokenSlackWaitResult, RESTPostAPIWebhookWithTokenSlackWaitResult,
RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenWaitResult,
} from 'discord-api-types/v10'; } from '../../types';
import type { ProxyRequestMethod } from '../Router'; import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api'; import type { RestArguments } from '../api';

View File

@ -1,4 +1,4 @@
import { filetypeinfo } from 'magic-bytes.js'; import { filetypemime } from 'magic-bytes.js';
import { randomUUID } from 'node:crypto'; import { randomUUID } from 'node:crypto';
import { Logger, delay, lazyLoadPackage } from '../common'; import { Logger, delay, lazyLoadPackage } from '../common';
import { snowflakeToTimestamp } from '../structures/extra/functions'; import { snowflakeToTimestamp } from '../structures/extra/functions';
@ -353,14 +353,10 @@ export class ApiHandler {
let contentType = file.contentType; let contentType = file.contentType;
if (!contentType) { if (!contentType) {
const [parsedType] = filetypeinfo(file.data); const mime = filetypemime(Buffer.from(file.data))[0];
if (parsedType) { contentType =
contentType = OverwrittenMimeTypes[mime as keyof typeof OverwrittenMimeTypes] ?? mime ?? 'application/octet-stream';
OverwrittenMimeTypes[parsedType.mime as keyof typeof OverwrittenMimeTypes] ??
parsedType.mime ??
'application/octet-stream';
}
} }
formData.append(fileKey, new Blob([file.data], { type: contentType }), file.name); formData.append(fileKey, new Blob([file.data], { type: contentType }), file.name);

View File

@ -1,4 +1,4 @@
import type { Snowflake } from 'discord-api-types/v10'; import type { Snowflake } from '../../types';
/** /**
* Calculates the default avatar index for a given user id. * Calculates the default avatar index for a given user id.

View File

@ -3,7 +3,7 @@ import {
type APIActionRowComponent, type APIActionRowComponent,
type APIActionRowComponentTypes, type APIActionRowComponentTypes,
type APIMessageActionRowComponent, type APIMessageActionRowComponent,
} from 'discord-api-types/v10'; } from '../types';
import type { RestOrArray } from '../common/types/util'; import type { RestOrArray } from '../common/types/util';
import { BaseComponentBuilder } from './Base'; import { BaseComponentBuilder } from './Base';
import { fromComponent } from './index'; import { fromComponent } from './index';

View File

@ -1,4 +1,4 @@
import type { APIAttachment, RESTAPIAttachment } from 'discord-api-types/v10'; import type { APIAttachment, RESTAPIAttachment } from '../types';
import { randomBytes } from 'node:crypto'; import { randomBytes } from 'node:crypto';
import path from 'node:path'; import path from 'node:path';
import { type UsingClient, throwError, type RawFile } from '..'; import { type UsingClient, throwError, type RawFile } from '..';

View File

@ -1,4 +1,4 @@
import type { APIBaseComponent, ComponentType } from 'discord-api-types/v10'; import type { APIBaseComponent, ComponentType } from '../types';
export abstract class BaseComponentBuilder< export abstract class BaseComponentBuilder<
TYPE extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>, TYPE extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>,

View File

@ -1,9 +1,4 @@
import { import { type APIMessageComponentEmoji, type ButtonStyle, ComponentType, type APIButtonComponent } from '../types';
type APIMessageComponentEmoji,
type ButtonStyle,
ComponentType,
type APIButtonComponent,
} from 'discord-api-types/v10';
import type { EmojiResolvable } from '../common'; import type { EmojiResolvable } from '../common';
import { resolvePartialEmoji } from '../structures/extra/functions'; import { resolvePartialEmoji } from '../structures/extra/functions';

View File

@ -1,4 +1,4 @@
import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter } from 'discord-api-types/v10'; import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter } from '../types';
import { resolveColor, toSnakeCase, type ColorResolvable, type ObjectToLower, type RestOrArray } from '../common'; import { resolveColor, toSnakeCase, type ColorResolvable, type ObjectToLower, type RestOrArray } from '../common';
/** /**

View File

@ -4,7 +4,7 @@ import {
type APITextInputComponent, type APITextInputComponent,
ComponentType, ComponentType,
type TextInputStyle, type TextInputStyle,
} from 'discord-api-types/v10'; } from '../types';
import type { RestOrArray } from '../common'; import type { RestOrArray } from '../common';
import type { ActionRow } from './ActionRow'; import type { ActionRow } from './ActionRow';
import { BaseComponentBuilder, type OptionValuesLength } from './Base'; import { BaseComponentBuilder, type OptionValuesLength } from './Base';

View File

@ -1,4 +1,4 @@
import { type APIPollMedia, PollLayoutType, type RESTAPIPollCreate } from 'discord-api-types/v10'; import { type APIPollMedia, PollLayoutType, type RESTAPIPollCreate } from '../types';
import type { DeepPartial, EmojiResolvable, RestOrArray } from '../common'; import type { DeepPartial, EmojiResolvable, RestOrArray } from '../common';
import { throwError } from '..'; import { throwError } from '..';
import { resolvePartialEmoji } from '../structures/extra/functions'; import { resolvePartialEmoji } from '../structures/extra/functions';

View File

@ -11,7 +11,7 @@ import {
type ChannelType, type ChannelType,
ComponentType, ComponentType,
SelectMenuDefaultValueType, SelectMenuDefaultValueType,
} from 'discord-api-types/v10'; } from '../types';
import { throwError } from '..'; import { throwError } from '..';
import type { EmojiResolvable, RestOrArray, ToClass } from '../common'; import type { EmojiResolvable, RestOrArray, ToClass } from '../common';
import type { import type {

View File

@ -1,4 +1,4 @@
import { type APIActionRowComponent, type APIActionRowComponentTypes, ComponentType } from 'discord-api-types/v10'; import { type APIActionRowComponent, type APIActionRowComponentTypes, ComponentType } from '../types';
import { ActionRow } from './ActionRow'; import { ActionRow } from './ActionRow';
import { Button } from './Button'; import { Button } from './Button';
import { TextInput } from './Modal'; import { TextInput } from './Modal';

10
src/cache/index.ts vendored
View File

@ -17,6 +17,10 @@ import { VoiceStates } from './resources/voice-states';
import { Bans } from './resources/bans'; import { Bans } from './resources/bans';
import { import {
ChannelType,
GatewayIntentBits,
GuildMemberFlags,
OverwriteType,
type APIChannel, type APIChannel,
type APIEmoji, type APIEmoji,
type APIGuildMember, type APIGuildMember,
@ -24,12 +28,8 @@ import {
type APISticker, type APISticker,
type APITextChannel, type APITextChannel,
type APIUser, type APIUser,
ChannelType,
GatewayIntentBits,
GuildMemberFlags,
OverwriteType,
type GatewayDispatchPayload, type GatewayDispatchPayload,
} from 'discord-api-types/v10'; } from '../types';
import type { InternalOptions, UsingClient } from '../commands'; import type { InternalOptions, UsingClient } from '../commands';
import { Overwrites } from './resources/overwrites'; import { Overwrites } from './resources/overwrites';
import { Messages } from './resources/messages'; import { Messages } from './resources/messages';

View File

@ -1,4 +1,4 @@
import type { APIBan, GatewayGuildBanModifyDispatchData } from 'discord-api-types/v10'; import type { APIBan, GatewayGuildBanModifyDispatchData } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildBasedResource } from './default/guild-based'; import { GuildBasedResource } from './default/guild-based';

View File

@ -1,4 +1,4 @@
import type { APIChannel } from 'discord-api-types/v10'; import type { APIChannel } from '../../types';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import type { AllChannels } from '../../structures'; import type { AllChannels } from '../../structures';
import channelFrom from '../../structures/channels'; import channelFrom from '../../structures/channels';

View File

@ -1,6 +1,6 @@
import type { GatewayIntentBits } from 'discord-api-types/v10';
import type { UsingClient } from '../../../commands'; import type { UsingClient } from '../../../commands';
import { fakePromise } from '../../../common'; import { fakePromise } from '../../../common';
import type { GatewayIntentBits } from '../../../types';
import type { Cache, ReturnCache } from '../../index'; import type { Cache, ReturnCache } from '../../index';
export class BaseResource<T = any, S = any> { export class BaseResource<T = any, S = any> {

View File

@ -1,6 +1,6 @@
import type { GatewayIntentBits } from 'discord-api-types/v10';
import type { UsingClient } from '../../../commands'; import type { UsingClient } from '../../../commands';
import { fakePromise } from '../../../common'; import { fakePromise } from '../../../common';
import type { GatewayIntentBits } from '../../../types';
import type { Cache, ReturnCache } from '../../index'; import type { Cache, ReturnCache } from '../../index';
export class GuildBasedResource<T = any, S = any> { export class GuildBasedResource<T = any, S = any> {

View File

@ -1,7 +1,7 @@
import type { GatewayIntentBits } from 'discord-api-types/v10';
import type { BaseClient } from '../../../client/base'; import type { BaseClient } from '../../../client/base';
import type { UsingClient } from '../../../commands'; import type { UsingClient } from '../../../commands';
import { fakePromise } from '../../../common'; import { fakePromise } from '../../../common';
import type { GatewayIntentBits } from '../../../types';
import type { Cache, ReturnCache } from '../../index'; import type { Cache, ReturnCache } from '../../index';
export class GuildRelatedResource<T = any, S = any> { export class GuildRelatedResource<T = any, S = any> {

View File

@ -1,4 +1,4 @@
import type { APIEmoji } from 'discord-api-types/v10'; import type { APIEmoji } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';

View File

@ -1,4 +1,4 @@
import type { APIGuild, GatewayGuildCreateDispatchData } from 'discord-api-types/v10'; import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types';
import type { Cache, ReturnCache } from '..'; import type { Cache, ReturnCache } from '..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { BaseResource } from './default/base'; import { BaseResource } from './default/base';

View File

@ -1,4 +1,4 @@
import type { APIGuildMember } from 'discord-api-types/v10'; import type { APIGuildMember } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildBasedResource } from './default/guild-based'; import { GuildBasedResource } from './default/guild-based';

View File

@ -1,4 +1,4 @@
import type { APIMessage, APIUser } from 'discord-api-types/v10'; import type { APIMessage, APIUser } from '../../types';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';
import type { MessageData, ReturnCache } from '../..'; import type { MessageData, ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';

View File

@ -1,4 +1,4 @@
import type { APIOverwrite } from 'discord-api-types/v10'; import type { APIOverwrite } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common/it/utils'; import { fakePromise } from '../../common/it/utils';
import { PermissionsBitField } from '../../structures/extra/Permissions'; import { PermissionsBitField } from '../../structures/extra/Permissions';

View File

@ -1,4 +1,4 @@
import type { GatewayPresenceUpdate } from 'discord-api-types/v10'; import type { GatewayPresenceUpdate } from '../../types';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';
export class Presences extends GuildRelatedResource<PresenceResource, GatewayPresenceUpdate> { export class Presences extends GuildRelatedResource<PresenceResource, GatewayPresenceUpdate> {

View File

@ -1,4 +1,4 @@
import type { APIRole } from 'discord-api-types/v10'; import type { APIRole } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';

View File

@ -1,4 +1,4 @@
import type { APIStageInstance } from 'discord-api-types/v10'; import type { APIStageInstance } from '../../types';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';
export class StageInstances extends GuildRelatedResource<APIStageInstance, APIStageInstance> { export class StageInstances extends GuildRelatedResource<APIStageInstance, APIStageInstance> {

View File

@ -1,4 +1,4 @@
import type { APISticker } from 'discord-api-types/v10'; import type { APISticker } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';

View File

@ -1,4 +1,4 @@
import type { APIThreadChannel } from 'discord-api-types/v10'; import type { APIThreadChannel } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildRelatedResource } from './default/guild-related'; import { GuildRelatedResource } from './default/guild-related';

View File

@ -1,4 +1,4 @@
import type { APIUser } from 'discord-api-types/v10'; import type { APIUser } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { BaseResource } from './default/base'; import { BaseResource } from './default/base';

View File

@ -1,4 +1,4 @@
import type { GatewayVoiceState } from 'discord-api-types/v10'; import type { GatewayVoiceState } from '../../types';
import type { ReturnCache } from '../..'; import type { ReturnCache } from '../..';
import { fakePromise } from '../../common'; import { fakePromise } from '../../common';
import { GuildBasedResource } from './default/guild-based'; import { GuildBasedResource } from './default/guild-based';

View File

@ -35,7 +35,7 @@ import {
type MakeRequired, type MakeRequired,
} from '../common'; } from '../common';
import type { LocaleString, RESTPostAPIChannelMessageJSONBody } from 'discord-api-types/rest/v10'; import type { LocaleString, RESTPostAPIChannelMessageJSONBody } from '../types';
import type { Awaitable, DeepPartial, IntentStrings, OmitInsert, PermissionStrings, When } from '../common/types/util'; import type { Awaitable, DeepPartial, IntentStrings, OmitInsert, PermissionStrings, When } from '../common/types/util';
import { ComponentHandler } from '../components/handler'; import { ComponentHandler } from '../components/handler';
import { LangsHandler } from '../langs/handler'; import { LangsHandler } from '../langs/handler';

View File

@ -1,4 +1,4 @@
import { GatewayIntentBits, type GatewayDispatchPayload, type GatewayPresenceUpdateData } from 'discord-api-types/v10'; import { type GatewayDispatchPayload, type GatewayPresenceUpdateData, GatewayIntentBits } from '../types';
import type { CommandContext, Message } from '..'; import type { CommandContext, Message } from '..';
import { import {
type Awaitable, type Awaitable,

View File

@ -1,10 +1,5 @@
import { import { type APIInteractionResponse, InteractionResponseType, InteractionType, type APIInteraction } from '../types';
type APIInteractionResponse, import { filetypemime } from 'magic-bytes.js';
InteractionResponseType,
InteractionType,
type APIInteraction,
} from 'discord-api-types/v10';
import { filetypeinfo } from 'magic-bytes.js';
import type { HttpRequest, HttpResponse } from 'uWebSockets.js'; import type { HttpRequest, HttpResponse } from 'uWebSockets.js';
import { OverwrittenMimeTypes } from '../api'; import { OverwrittenMimeTypes } from '../api';
import { isBufferLike } from '../api/utils/utils'; import { isBufferLike } from '../api/utils/utils';
@ -179,14 +174,12 @@ export class HttpClient extends BaseClient {
let contentType = file.contentType; let contentType = file.contentType;
if (!contentType) { if (!contentType) {
const [parsedType] = filetypeinfo(file.data); const mime = filetypemime(Buffer.from(file.data))[0];
if (parsedType) { contentType =
contentType = OverwrittenMimeTypes[mime as keyof typeof OverwrittenMimeTypes] ??
OverwrittenMimeTypes[parsedType.mime as keyof typeof OverwrittenMimeTypes] ?? mime ??
parsedType.mime ?? 'application/octet-stream';
'application/octet-stream';
}
} }
response.append(fileKey, new Blob([file.data], { type: contentType }), file.name); response.append(fileKey, new Blob([file.data], { type: contentType }), file.name);
} else { } else {
@ -237,14 +230,12 @@ export class HttpClient extends BaseClient {
let contentType = file.contentType; let contentType = file.contentType;
if (!contentType) { if (!contentType) {
const [parsedType] = filetypeinfo(file.data); const mime = filetypemime(Buffer.from(file.data))[0];
if (parsedType) { contentType =
contentType = OverwrittenMimeTypes[mime as keyof typeof OverwrittenMimeTypes] ??
OverwrittenMimeTypes[parsedType.mime as keyof typeof OverwrittenMimeTypes] ?? mime ??
parsedType.mime ?? 'application/octet-stream';
'application/octet-stream';
}
} }
response.append(fileKey, new Blob([file.data], { type: contentType }), file.name); response.append(fileKey, new Blob([file.data], { type: contentType }), file.name);
} else { } else {

View File

@ -1,4 +1,4 @@
import type { ChannelType } from 'discord-api-types/v10'; import type { ChannelType } from '../types';
import { type CustomStructures, OptionResolver } from '../commands'; import { type CustomStructures, OptionResolver } from '../commands';
import { import {
AnonymousGuild, AnonymousGuild,
@ -30,7 +30,7 @@ import {
Webhook, Webhook,
WebhookMessage, WebhookMessage,
} from '../structures'; } from '../structures';
import type { StructStates } from '../common/types/util'; import type { StructStates } from '../common/';
import { GuildBan } from '../structures/GuildBan'; import { GuildBan } from '../structures/GuildBan';
export type PollStructure = InferCustomStructure<Poll, 'Poll'>; export type PollStructure = InferCustomStructure<Poll, 'Poll'>;

View File

@ -1,4 +1,4 @@
import { GatewayIntentBits, type GatewayDispatchPayload, type GatewaySendPayload } from 'discord-api-types/v10'; import { type GatewayDispatchPayload, type GatewaySendPayload, GatewayIntentBits } from '../types';
import { randomUUID } from 'node:crypto'; import { randomUUID } from 'node:crypto';
import { ApiHandler, Logger } from '..'; import { ApiHandler, Logger } from '..';
import type { Cache } from '../cache'; import type { Cache } from '../cache';

View File

@ -7,7 +7,7 @@ import {
type APIApplicationCommandOption, type APIApplicationCommandOption,
type APIApplicationCommandSubcommandGroupOption, type APIApplicationCommandSubcommandGroupOption,
type LocaleString, type LocaleString,
} from 'discord-api-types/v10'; } from '../../types';
import type { import type {
ComponentContext, ComponentContext,
MenuCommandContext, MenuCommandContext,

View File

@ -1,4 +1,4 @@
import { MessageFlags } from 'discord-api-types/v10'; import { MessageFlags } from '../../types';
import type { AllChannels, InferWithPrefix, Message, ReturnCache } from '../..'; import type { AllChannels, InferWithPrefix, Message, ReturnCache } from '../..';
import type { Client, WorkerClient } from '../../client'; import type { Client, WorkerClient } from '../../client';
import type { If, UnionToTuple, When } from '../../common'; import type { If, UnionToTuple, When } from '../../common';

View File

@ -3,7 +3,7 @@ import type {
ApplicationIntegrationType, ApplicationIntegrationType,
InteractionContextType, InteractionContextType,
LocaleString, LocaleString,
} from 'discord-api-types/v10'; } from '../../types';
import { magicImport, type PermissionStrings } from '../../common'; import { magicImport, type PermissionStrings } from '../../common';
import type { RegisteredMiddlewares } from '../decorators'; import type { RegisteredMiddlewares } from '../decorators';
import type { MenuCommandContext } from './menucontext'; import type { MenuCommandContext } from './menucontext';

View File

@ -1,4 +1,4 @@
import { type APIMessage, ApplicationCommandType, MessageFlags } from 'discord-api-types/v10'; import { type APIMessage, ApplicationCommandType, MessageFlags } from '../../types';
import type { ContextMenuCommand, ReturnCache } from '../..'; import type { ContextMenuCommand, ReturnCache } from '../..';
import { import {
toSnakeCase, toSnakeCase,

View File

@ -1,8 +1,4 @@
import { import { ApplicationCommandOptionType, type APIApplicationCommandOptionChoice, type ChannelType } from '../../types';
ApplicationCommandOptionType,
type APIApplicationCommandOptionChoice,
type ChannelType,
} from 'discord-api-types/v10';
import type { import type {
AutocompleteCallback, AutocompleteCallback,
MenuCommandContext, MenuCommandContext,

View File

@ -1,6 +1,6 @@
import type { ChannelType } from 'discord-api-types/v10';
import type { BaseClient } from '../../client/base'; import type { BaseClient } from '../../client/base';
import type { IsStrictlyUndefined } from '../../common'; import type { IsStrictlyUndefined } from '../../common';
import type { ChannelType } from '../../types';
import type { RegisteredMiddlewares } from '../decorators'; import type { RegisteredMiddlewares } from '../decorators';
export type OKFunction<T> = (value: T) => void; export type OKFunction<T> = (value: T) => void;

View File

@ -4,7 +4,7 @@ import {
InteractionContextType, InteractionContextType,
PermissionFlagsBits, PermissionFlagsBits,
type LocaleString, type LocaleString,
} from 'discord-api-types/v10'; } from '../types';
import type { FlatObjectKeys, PermissionStrings } from '../common'; import type { FlatObjectKeys, PermissionStrings } from '../common';
import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat'; import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat';
import type { DefaultLocale, ExtraProps, IgnoreCommand, MiddlewareContext } from './applications/shared'; import type { DefaultLocale, ExtraProps, IgnoreCommand, MiddlewareContext } from './applications/shared';

View File

@ -7,9 +7,9 @@ import {
InteractionContextType, InteractionContextType,
type APIApplicationCommandInteractionDataOption, type APIApplicationCommandInteractionDataOption,
ApplicationCommandOptionType, ApplicationCommandOptionType,
ChannelType,
type APIInteractionDataResolvedChannel, type APIInteractionDataResolvedChannel,
} from 'discord-api-types/v10'; ChannelType,
} from '../types';
import { import {
Command, Command,
type ContextOptionsResolved, type ContextOptionsResolved,

View File

@ -9,7 +9,7 @@ import {
type APIApplicationCommandSubcommandGroupOption, type APIApplicationCommandSubcommandGroupOption,
type APIApplicationCommandChannelOption, type APIApplicationCommandChannelOption,
type LocalizationMap, type LocalizationMap,
} from 'discord-api-types/v10'; } from '../types';
import { basename, dirname } from 'node:path'; import { basename, dirname } from 'node:path';
import type { Logger, MakeRequired, NulleableCoalising, OmitInsert } from '../common'; import type { Logger, MakeRequired, NulleableCoalising, OmitInsert } from '../common';
import { BaseHandler } from '../common'; import { BaseHandler } from '../common';
@ -50,7 +50,7 @@ export class CommandHandler extends BaseHandler {
} }
protected shouldUploadLocales(locales?: LocalizationMap | null, cachedLocales?: LocalizationMap | null) { protected shouldUploadLocales(locales?: LocalizationMap | null, cachedLocales?: LocalizationMap | null) {
if (!locales && !cachedLocales) return false; if (!(locales || cachedLocales)) return false;
if (!locales && cachedLocales) return true; if (!locales && cachedLocales) return true;
if (locales && !cachedLocales) return true; if (locales && !cachedLocales) return true;
if (locales && cachedLocales) { if (locales && cachedLocales) {

View File

@ -7,7 +7,7 @@ import {
type APIRole, type APIRole,
type APIUser, type APIUser,
ApplicationCommandOptionType, ApplicationCommandOptionType,
} from 'discord-api-types/v10'; } from '../types';
import { Attachment } from '..'; import { Attachment } from '..';
import type { MakeRequired } from '../common'; import type { MakeRequired } from '../common';
import type { AllChannels } from '../structures'; import type { AllChannels } from '../structures';

View File

@ -1,4 +1,4 @@
import type { GatewayDispatchPayload, GatewaySendPayload } from 'discord-api-types/v10'; import type { GatewayDispatchPayload, GatewaySendPayload } from '../../types';
import { execSync } from 'node:child_process'; import { execSync } from 'node:child_process';
import { ApiHandler, Router } from '../../api'; import { ApiHandler, Router } from '../../api';
import { BaseClient, type InternalRuntimeConfig } from '../../client/base'; import { BaseClient, type InternalRuntimeConfig } from '../../client/base';

View File

@ -3,7 +3,7 @@ import type {
RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansQuery,
RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanJSONBody,
RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import { BaseShorter } from './base'; import { BaseShorter } from './base';
import { Transformers } from '../../client/transformers'; import { Transformers } from '../../client/transformers';

View File

@ -1,13 +1,11 @@
import { import type {
type APIChannel, APIChannel,
PermissionFlagsBits, RESTGetAPIChannelMessagesQuery,
type RESTGetAPIChannelMessagesQuery, RESTPatchAPIChannelJSONBody,
type RESTPatchAPIChannelJSONBody, RESTPostAPIChannelThreadsJSONBody,
type RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody,
type RESTPostAPIGuildForumThreadsJSONBody, APIGuildChannel,
type ChannelType, } from '../../types';
type APIGuildChannel,
} from 'discord-api-types/v10';
import { BaseChannel, type GuildRole, type GuildMember } from '../../structures'; import { BaseChannel, type GuildRole, type GuildMember } from '../../structures';
import channelFrom, { type AllChannels } from '../../structures/channels'; import channelFrom, { type AllChannels } from '../../structures/channels';
import { PermissionsBitField } from '../../structures/extra/Permissions'; import { PermissionsBitField } from '../../structures/extra/Permissions';
@ -15,6 +13,7 @@ import { BaseShorter } from './base';
import { MergeOptions } from '../it/utils'; import { MergeOptions } from '../it/utils';
import { type MessageStructure, Transformers } from '../../client/transformers'; import { type MessageStructure, Transformers } from '../../client/transformers';
import type { MakeRequired } from '../types/util'; import type { MakeRequired } from '../types/util';
import { type ChannelType, PermissionFlagsBits } from '../../types';
export class ChannelShorter extends BaseShorter { export class ChannelShorter extends BaseShorter {
/** /**

View File

@ -1,4 +1,4 @@
import type { APIEmoji, RESTPatchAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiJSONBody } from 'discord-api-types/v10'; import type { APIEmoji, RESTPatchAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiJSONBody } from '../../types';
import { resolveImage } from '../../builders'; import { resolveImage } from '../../builders';
import type { ImageResolvable } from '../types/resolvables'; import type { ImageResolvable } from '../types/resolvables';
import type { OmitInsert } from '../types/util'; import type { OmitInsert } from '../types/util';

View File

@ -10,7 +10,7 @@ import type {
RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleJSONBody,
RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelJSONBody,
RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import { resolveFiles } from '../../builders'; import { resolveFiles } from '../../builders';
import { BaseChannel, Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures'; import { BaseChannel, Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures';
import channelFrom from '../../structures/channels'; import channelFrom from '../../structures/channels';

View File

@ -1,12 +1,12 @@
import { FormattingPatterns } from 'discord-api-types/globals'; import {
import type { type APIGuildMember,
APIGuildMember, type RESTGetAPIGuildMembersQuery,
RESTGetAPIGuildMembersQuery, type RESTGetAPIGuildMembersSearchQuery,
RESTGetAPIGuildMembersSearchQuery, type RESTPatchAPIGuildMemberJSONBody,
RESTPatchAPIGuildMemberJSONBody, type RESTPutAPIGuildBanJSONBody,
RESTPutAPIGuildBanJSONBody, type RESTPutAPIGuildMemberJSONBody,
RESTPutAPIGuildMemberJSONBody, FormattingPatterns,
} from 'discord-api-types/v10'; } from '../../types';
import { PermissionsBitField } from '../../structures/extra/Permissions'; import { PermissionsBitField } from '../../structures/extra/Permissions';
import type { GuildMemberResolvable } from '../types/resolvables'; import type { GuildMemberResolvable } from '../types/resolvables';
import { BaseShorter } from './base'; import { BaseShorter } from './base';

View File

@ -2,7 +2,7 @@ import type {
RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody,
RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageJSONBody,
RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import { resolveFiles } from '../../builders'; import { resolveFiles } from '../../builders';
import { MessagesMethods } from '../../structures'; import { MessagesMethods } from '../../structures';

View File

@ -1,4 +1,4 @@
import type { RESTGetAPIChannelMessageReactionUsersQuery } from 'discord-api-types/v10'; import type { RESTGetAPIChannelMessageReactionUsersQuery } from '../../types';
import { encodeEmoji, resolveEmoji } from '../../structures/extra/functions'; import { encodeEmoji, resolveEmoji } from '../../structures/extra/functions';
import type { EmojiResolvable } from '../types/resolvables'; import type { EmojiResolvable } from '../types/resolvables';
import { BaseShorter } from './base'; import { BaseShorter } from './base';

View File

@ -3,7 +3,7 @@ import type {
RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRoleJSONBody,
RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsJSONBody,
RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import { BaseShorter } from './base'; import { BaseShorter } from './base';
import { Transformers } from '../../client/transformers'; import { Transformers } from '../../client/transformers';

View File

@ -1,4 +1,4 @@
import type { RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from 'discord-api-types/v10'; import type { RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from '../../types';
import { BaseShorter } from './base'; import { BaseShorter } from './base';
import { Transformers } from '../../client/transformers'; import { Transformers } from '../../client/transformers';

View File

@ -6,7 +6,7 @@ import type {
RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsJSONBody,
RESTPostAPIChannelThreadsJSONBody, RESTPostAPIChannelThreadsJSONBody,
RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import channelFrom from '../../structures/channels'; import channelFrom from '../../structures/channels';
import { BaseShorter } from './base'; import { BaseShorter } from './base';
import type { MakeRequired, When } from '../types/util'; import type { MakeRequired, When } from '../types/util';

View File

@ -3,7 +3,7 @@ import type {
RESTPatchAPIWebhookWithTokenJSONBody, RESTPatchAPIWebhookWithTokenJSONBody,
RESTPostAPIChannelWebhookJSONBody, RESTPostAPIChannelWebhookJSONBody,
RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import { resolveFiles } from '../../builders'; import { resolveFiles } from '../../builders';
import { import {
MessagesMethods, MessagesMethods,

View File

@ -1,4 +1,4 @@
import type { APIPartialEmoji } from 'discord-api-types/v10'; import type { APIPartialEmoji } from '../../types';
import type { EmbedColors } from '..'; import type { EmbedColors } 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';

View File

@ -1,4 +1,4 @@
import type { GatewayIntentBits, PermissionFlagsBits } from 'discord-api-types/v10'; import type { GatewayIntentBits, PermissionFlagsBits } from '../../types';
export type ToClass<T, This> = new ( export type ToClass<T, This> = new (
...args: any[] ...args: any[]

View File

@ -10,7 +10,7 @@ import type {
RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody,
RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageJSONBody,
RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenJSONBody,
} from 'discord-api-types/v10'; } from '../../types';
import type { RawFile } from '../../api'; import type { RawFile } from '../../api';
import type { import type {
ActionRow, ActionRow,

View File

@ -1,4 +1,4 @@
import type { APIMessageActionRowComponent, ComponentType } from 'discord-api-types/v10'; import type { APIMessageActionRowComponent, ComponentType } from '../types';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';
import type { ActionRowMessageComponents } from './index'; import type { ActionRowMessageComponents } from './index';
import { componentFactory } from './index'; import { componentFactory } from './index';

View File

@ -9,7 +9,7 @@ import {
type APITextInputComponent, type APITextInputComponent,
type APIUserSelectComponent, type APIUserSelectComponent,
ComponentType, ComponentType,
} from 'discord-api-types/v10'; } from '../types';
import { fromComponent } from '../builders'; import { fromComponent } from '../builders';
export class BaseComponent<T extends ComponentType> { export class BaseComponent<T extends ComponentType> {

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';
export type APISelectMenuComponentTypes = export type APISelectMenuComponentTypes =

View File

@ -4,7 +4,7 @@ import type {
APIButtonComponentWithURL, APIButtonComponentWithURL,
ButtonStyle, ButtonStyle,
ComponentType, ComponentType,
} from 'discord-api-types/v10'; } from '../types';
import { Button } from '../builders'; import { Button } from '../builders';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
export class ChannelSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.ChannelSelect> { export class ChannelSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.ChannelSelect> {

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
export class MentionableSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.MentionableSelect> { export class MentionableSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.MentionableSelect> {

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
export class RoleSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.RoleSelect> { export class RoleSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.RoleSelect> {

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
export class StringSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.StringSelect> { export class StringSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.StringSelect> {

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';
export class TextInputComponent extends BaseComponent<ComponentType.TextInput> { export class TextInputComponent extends BaseComponent<ComponentType.TextInput> {

View File

@ -1,4 +1,4 @@
import type { ComponentType } from 'discord-api-types/v10'; import type { ComponentType } from '../types';
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent'; import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
export class UserSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.UserSelect> { export class UserSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.UserSelect> {

View File

@ -1,4 +1,4 @@
import { ComponentType } from 'discord-api-types/v10'; import { ComponentType } from '../types';
import type { ContextComponentCommandInteractionMap, ComponentContext } from './componentcontext'; import type { ContextComponentCommandInteractionMap, ComponentContext } from './componentcontext';
import type { ExtraProps, RegisteredMiddlewares, UsingClient } from '../commands'; import type { ExtraProps, RegisteredMiddlewares, UsingClient } from '../commands';

View File

@ -1,4 +1,4 @@
import { ComponentType, MessageFlags } from 'discord-api-types/v10'; import { ComponentType, MessageFlags } from '../types';
import type { import type {
AllChannels, AllChannels,
ButtonInteraction, ButtonInteraction,

View File

@ -1,4 +1,4 @@
import { type APIMessageActionRowComponent, ButtonStyle, ComponentType } from 'discord-api-types/v10'; import { type APIMessageActionRowComponent, ButtonStyle, ComponentType } from '../types';
import { BaseComponent } from './BaseComponent'; import { BaseComponent } from './BaseComponent';
import { ButtonComponent, LinkButtonComponent, SKUButtonComponent } from './ButtonComponent'; import { ButtonComponent, LinkButtonComponent, SKUButtonComponent } from './ButtonComponent';
import { ChannelSelectMenuComponent } from './ChannelSelectMenuComponent'; import { ChannelSelectMenuComponent } from './ChannelSelectMenuComponent';

View File

@ -1,4 +1,4 @@
import { MessageFlags } from 'discord-api-types/v10'; import { MessageFlags } from '../types';
import type { AllChannels, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..'; import type { AllChannels, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..';
import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands'; import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
import { BaseContext } from '../commands/basecontext'; import { BaseContext } from '../commands/basecontext';

View File

@ -3,7 +3,7 @@ import type {
GatewayMessageCreateDispatch, GatewayMessageCreateDispatch,
GatewayMessageDeleteBulkDispatch, GatewayMessageDeleteBulkDispatch,
GatewayMessageDeleteDispatch, GatewayMessageDeleteDispatch,
} from 'discord-api-types/v10'; } from '../types';
import type { Client, WorkerClient } from '../client'; import type { Client, WorkerClient } from '../client';
import { BaseHandler, ReplaceRegex, magicImport, type MakeRequired, type SnakeCase } from '../common'; import { BaseHandler, ReplaceRegex, magicImport, type MakeRequired, type SnakeCase } from '../common';
import type { ClientEvents } from '../events/hooks'; import type { ClientEvents } from '../events/hooks';

View File

@ -1,4 +1,4 @@
import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from 'discord-api-types/v10'; import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../types';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';

View File

@ -3,7 +3,7 @@ import type {
GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleCreateDispatchData,
GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleDeleteDispatchData,
GatewayAutoModerationRuleUpdateDispatchData, GatewayAutoModerationRuleUpdateDispatchData,
} from 'discord-api-types/v10'; } from '../../types';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { Transformers } from '../../client/transformers'; import { Transformers } from '../../client/transformers';

View File

@ -3,7 +3,7 @@ import type {
GatewayChannelDeleteDispatchData, GatewayChannelDeleteDispatchData,
GatewayChannelPinsUpdateDispatchData, GatewayChannelPinsUpdateDispatchData,
GatewayChannelUpdateDispatchData, GatewayChannelUpdateDispatchData,
} from 'discord-api-types/v10'; } from '../../types';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';
import type { AllChannels } from '../../structures'; import type { AllChannels } from '../../structures';

View File

@ -1,4 +1,4 @@
import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from 'discord-api-types/v10'; import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from '../../types';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { Transformers } from '../../client/transformers'; import { Transformers } from '../../client/transformers';

View File

@ -1,4 +1,4 @@
import type { APIEntitlement } from 'discord-api-types/v10'; import type { APIEntitlement } from '../../types';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';

View File

@ -20,7 +20,7 @@ import type {
GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData,
GatewayGuildStickersUpdateDispatchData, GatewayGuildStickersUpdateDispatchData,
GatewayGuildUpdateDispatchData, GatewayGuildUpdateDispatchData,
} from 'discord-api-types/v10'; } from '../../types';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { import {

View File

@ -2,7 +2,7 @@ import type {
GatewayIntegrationCreateDispatchData, GatewayIntegrationCreateDispatchData,
GatewayIntegrationDeleteDispatchData, GatewayIntegrationDeleteDispatchData,
GatewayIntegrationUpdateDispatchData, GatewayIntegrationUpdateDispatchData,
} from 'discord-api-types/v10'; } from '../../types';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { Transformers } from '../../client/transformers'; import { Transformers } from '../../client/transformers';

View File

@ -1,4 +1,4 @@
import type { GatewayInteractionCreateDispatchData } from 'discord-api-types/v10'; import type { GatewayInteractionCreateDispatchData } from '../../types';
import { BaseInteraction } from '../../structures'; import { BaseInteraction } from '../../structures';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';

View File

@ -1,4 +1,4 @@
import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from 'discord-api-types/v10'; import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from '../../types';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';

View File

@ -9,7 +9,7 @@ import type {
GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveDispatchData,
GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageReactionRemoveEmojiDispatchData,
GatewayMessageUpdateDispatchData, GatewayMessageUpdateDispatchData,
} from 'discord-api-types/v10'; } from '../../types';
import { type MakeRequired, type PartialClass, toCamelCase, type ObjectToLower } from '../../common'; import { type MakeRequired, type PartialClass, toCamelCase, type ObjectToLower } from '../../common';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { type MessageStructure, Transformers } from '../../client/transformers'; import { type MessageStructure, Transformers } from '../../client/transformers';

View File

@ -1,4 +1,4 @@
import type { GatewayPresenceUpdateDispatchData } from 'discord-api-types/v10'; import type { GatewayPresenceUpdateDispatchData } from '../../types';
import type { UsingClient } from '../../commands'; import type { UsingClient } from '../../commands';
import { toCamelCase } from '../../common'; import { toCamelCase } from '../../common';

Some files were not shown because too many files have changed in this diff Show More