mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 04:26:09 +00:00
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:
parent
04e17789e8
commit
bd951397a2
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,6 @@
|
||||
node_modules
|
||||
lib/
|
||||
dist/
|
||||
__test__
|
||||
__test__
|
||||
package-lock.json
|
||||
|
||||
|
@ -28,7 +28,8 @@
|
||||
"noDefaultExport": "off",
|
||||
"noNamespaceImport": "off",
|
||||
"useSingleCaseStatement": "off",
|
||||
"useBlockStatements": "off"
|
||||
"useBlockStatements": "off",
|
||||
"useEnumInitializers": "off"
|
||||
},
|
||||
"correctness": {
|
||||
"noUnusedVariables": "off",
|
||||
|
18
package.json
18
package.json
@ -6,7 +6,8 @@
|
||||
"module": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"files": [
|
||||
"lib/**"
|
||||
"lib/**",
|
||||
"deps/**"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --outDir ./lib",
|
||||
@ -20,7 +21,6 @@
|
||||
"author": "MARCROCK22",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"discord-api-types": "github:tiramisulabs/discord-api-types",
|
||||
"magic-bytes.js": "^1.10.0",
|
||||
"ts-mixer": "^6.0.4",
|
||||
"ws": "^8.18.0"
|
||||
@ -31,7 +31,7 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.8.1",
|
||||
"@biomejs/biome": "1.8.3",
|
||||
"@commitlint/cli": "^19.3.0",
|
||||
"@commitlint/config-conventional": "^19.2.2",
|
||||
"@types/node": "^20.14.11",
|
||||
@ -64,10 +64,20 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"contributors": [
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "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
83
pnpm-lock.yaml
generated
@ -8,9 +8,6 @@ importers:
|
||||
|
||||
.:
|
||||
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:
|
||||
specifier: ^1.10.0
|
||||
version: 1.10.0
|
||||
@ -35,8 +32,8 @@ importers:
|
||||
version: https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/f40213ec0a97d0d8721d9d32d92d6eb6ddcd22e7
|
||||
devDependencies:
|
||||
'@biomejs/biome':
|
||||
specifier: 1.8.1
|
||||
version: 1.8.1
|
||||
specifier: 1.8.3
|
||||
version: 1.8.3
|
||||
'@commitlint/cli':
|
||||
specifier: ^19.3.0
|
||||
version: 19.3.0(@types/node@20.14.11)(typescript@5.5.3)
|
||||
@ -73,55 +70,55 @@ packages:
|
||||
resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
'@biomejs/biome@1.8.1':
|
||||
resolution: {integrity: sha512-fQXGfvq6DIXem12dGQCM2tNF+vsNHH1qs3C7WeOu75Pd0trduoTmoO7G4ntLJ2qDs5wuw981H+cxQhi1uHnAtA==}
|
||||
'@biomejs/biome@1.8.3':
|
||||
resolution: {integrity: sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
hasBin: true
|
||||
|
||||
'@biomejs/cli-darwin-arm64@1.8.1':
|
||||
resolution: {integrity: sha512-XLiB7Uu6GALIOBWzQ2aMD0ru4Ly5/qSeQF7kk3AabzJ/kwsEWSe33iVySBP/SS2qv25cgqNiLksjGcw2bHT3mw==}
|
||||
'@biomejs/cli-darwin-arm64@1.8.3':
|
||||
resolution: {integrity: sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@biomejs/cli-darwin-x64@1.8.1':
|
||||
resolution: {integrity: sha512-uMTSxVLMfqkBVqyc25hSn83jBbp+wtWjzM/pHFlKXt3htJuw7FErVGW0nmQ9Sxa9vJ7GcqoltLMl28VQRIMYzg==}
|
||||
'@biomejs/cli-darwin-x64@1.8.3':
|
||||
resolution: {integrity: sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@biomejs/cli-linux-arm64-musl@1.8.1':
|
||||
resolution: {integrity: sha512-UQ8Wc01J0wQL+5AYOc7qkJn20B4PZmQL1KrmDZh7ot0DvD6aX4+8mmfd/dG5b6Zjo/44QvCKcvkFGCMRYuhWZA==}
|
||||
'@biomejs/cli-linux-arm64-musl@1.8.3':
|
||||
resolution: {integrity: sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@biomejs/cli-linux-arm64@1.8.1':
|
||||
resolution: {integrity: sha512-3SzZRuC/9Oi2P2IBNPsEj0KXxSXUEYRR2kfRF/Ve8QAfGgrt4qnwuWd6QQKKN5R+oYH691qjm+cXBKEcrP1v/Q==}
|
||||
'@biomejs/cli-linux-arm64@1.8.3':
|
||||
resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@biomejs/cli-linux-x64-musl@1.8.1':
|
||||
resolution: {integrity: sha512-fYbP/kNu/rtZ4kKzWVocIdqZOtBSUEg9qUhZaao3dy3CRzafR6u6KDtBeSCnt47O+iLnks1eOR1TUxzr5+QuqA==}
|
||||
'@biomejs/cli-linux-x64-musl@1.8.3':
|
||||
resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@biomejs/cli-linux-x64@1.8.1':
|
||||
resolution: {integrity: sha512-AeBycVdNrTzsyYKEOtR2R0Ph0hCD0sCshcp2aOnfGP0hCZbtFg09D0SdKLbyzKntisY41HxKVrydYiaApp+2uw==}
|
||||
'@biomejs/cli-linux-x64@1.8.3':
|
||||
resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@biomejs/cli-win32-arm64@1.8.1':
|
||||
resolution: {integrity: sha512-6tEd1H/iFKpgpE3OIB7oNgW5XkjiVMzMRPL8zYoZ036YfuJ5nMYm9eB9H/y81+8Z76vL48fiYzMPotJwukGPqQ==}
|
||||
'@biomejs/cli-win32-arm64@1.8.3':
|
||||
resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@biomejs/cli-win32-x64@1.8.1':
|
||||
resolution: {integrity: sha512-g2H31jJzYmS4jkvl6TiyEjEX+Nv79a5km/xn+5DARTp5MBFzC9gwceusSSB2AkJKqZzY131AiACAWjKrVt5Ijw==}
|
||||
'@biomejs/cli-win32-x64@1.8.3':
|
||||
resolution: {integrity: sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
@ -362,10 +359,6 @@ packages:
|
||||
resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==}
|
||||
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:
|
||||
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
|
||||
engines: {node: '>=8'}
|
||||
@ -871,39 +864,39 @@ snapshots:
|
||||
js-tokens: 4.0.0
|
||||
picocolors: 1.0.1
|
||||
|
||||
'@biomejs/biome@1.8.1':
|
||||
'@biomejs/biome@1.8.3':
|
||||
optionalDependencies:
|
||||
'@biomejs/cli-darwin-arm64': 1.8.1
|
||||
'@biomejs/cli-darwin-x64': 1.8.1
|
||||
'@biomejs/cli-linux-arm64': 1.8.1
|
||||
'@biomejs/cli-linux-arm64-musl': 1.8.1
|
||||
'@biomejs/cli-linux-x64': 1.8.1
|
||||
'@biomejs/cli-linux-x64-musl': 1.8.1
|
||||
'@biomejs/cli-win32-arm64': 1.8.1
|
||||
'@biomejs/cli-win32-x64': 1.8.1
|
||||
'@biomejs/cli-darwin-arm64': 1.8.3
|
||||
'@biomejs/cli-darwin-x64': 1.8.3
|
||||
'@biomejs/cli-linux-arm64': 1.8.3
|
||||
'@biomejs/cli-linux-arm64-musl': 1.8.3
|
||||
'@biomejs/cli-linux-x64': 1.8.3
|
||||
'@biomejs/cli-linux-x64-musl': 1.8.3
|
||||
'@biomejs/cli-win32-arm64': 1.8.3
|
||||
'@biomejs/cli-win32-x64': 1.8.3
|
||||
|
||||
'@biomejs/cli-darwin-arm64@1.8.1':
|
||||
'@biomejs/cli-darwin-arm64@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-darwin-x64@1.8.1':
|
||||
'@biomejs/cli-darwin-x64@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-arm64-musl@1.8.1':
|
||||
'@biomejs/cli-linux-arm64-musl@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-arm64@1.8.1':
|
||||
'@biomejs/cli-linux-arm64@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-x64-musl@1.8.1':
|
||||
'@biomejs/cli-linux-x64-musl@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-x64@1.8.1':
|
||||
'@biomejs/cli-linux-x64@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-win32-arm64@1.8.1':
|
||||
'@biomejs/cli-win32-arm64@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-win32-x64@1.8.1':
|
||||
'@biomejs/cli-win32-x64@1.8.3':
|
||||
optional: true
|
||||
|
||||
'@commitlint/cli@19.3.0(@types/node@20.14.11)(typescript@5.5.3)':
|
||||
@ -1185,8 +1178,6 @@ snapshots:
|
||||
denque@2.1.0:
|
||||
optional: true
|
||||
|
||||
discord-api-types@https://codeload.github.com/tiramisulabs/discord-api-types/tar.gz/fb7d551a671718f4e1b7b4010574c0f3a4d0a858: {}
|
||||
|
||||
dot-prop@5.3.0:
|
||||
dependencies:
|
||||
is-obj: 2.0.0
|
||||
|
@ -30,7 +30,8 @@ import type {
|
||||
RESTPostAPIApplicationEmojiResult,
|
||||
RESTPatchAPIApplicationEmojiResult,
|
||||
RESTDeleteAPIApplicationEmojiResult,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -55,7 +55,7 @@ import type {
|
||||
RESTPutAPIChannelRecipientJSONBody,
|
||||
RESTPutAPIChannelRecipientResult,
|
||||
RESTPutAPIChannelThreadMembersResult,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -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 { RestArguments } from '../api';
|
||||
|
||||
|
@ -112,7 +112,7 @@ import type {
|
||||
RESTPutAPIGuildMemberResult,
|
||||
RESTPutAPIGuildMemberRoleResult,
|
||||
RESTPutAPIGuildTemplateSyncResult,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type { Identify, OmitInsert } from '../../common';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { RESTPostAPIInteractionCallbackJSONBody } from 'discord-api-types/v10';
|
||||
import type { RESTPostAPIInteractionCallbackJSONBody } from '../../types';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -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 { RestArguments } from '../api';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import type {
|
||||
RESTPatchAPIStageInstanceResult,
|
||||
RESTPostAPIStageInstanceJSONBody,
|
||||
RESTPostAPIStageInstanceResult,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -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 { RestArguments } from '../api';
|
||||
|
||||
|
@ -13,7 +13,7 @@ import type {
|
||||
RESTPostAPICurrentUserCreateDMChannelJSONBody,
|
||||
RESTPutAPICurrentUserApplicationRoleConnectionJSONBody,
|
||||
RESTPutAPICurrentUserApplicationRoleConnectionResult,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10';
|
||||
import type { RESTGetAPIVoiceRegionsResult } from '../../types';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -21,7 +21,7 @@ import type {
|
||||
RESTPostAPIWebhookWithTokenSlackResult,
|
||||
RESTPostAPIWebhookWithTokenSlackWaitResult,
|
||||
RESTPostAPIWebhookWithTokenWaitResult,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type { ProxyRequestMethod } from '../Router';
|
||||
import type { RestArguments } from '../api';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { filetypeinfo } from 'magic-bytes.js';
|
||||
import { filetypemime } from 'magic-bytes.js';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { Logger, delay, lazyLoadPackage } from '../common';
|
||||
import { snowflakeToTimestamp } from '../structures/extra/functions';
|
||||
@ -353,14 +353,10 @@ export class ApiHandler {
|
||||
let contentType = file.contentType;
|
||||
|
||||
if (!contentType) {
|
||||
const [parsedType] = filetypeinfo(file.data);
|
||||
const mime = filetypemime(Buffer.from(file.data))[0];
|
||||
|
||||
if (parsedType) {
|
||||
contentType =
|
||||
OverwrittenMimeTypes[parsedType.mime as keyof typeof OverwrittenMimeTypes] ??
|
||||
parsedType.mime ??
|
||||
'application/octet-stream';
|
||||
}
|
||||
contentType =
|
||||
OverwrittenMimeTypes[mime as keyof typeof OverwrittenMimeTypes] ?? mime ?? 'application/octet-stream';
|
||||
}
|
||||
|
||||
formData.append(fileKey, new Blob([file.data], { type: contentType }), file.name);
|
||||
|
@ -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.
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
type APIActionRowComponent,
|
||||
type APIActionRowComponentTypes,
|
||||
type APIMessageActionRowComponent,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import type { RestOrArray } from '../common/types/util';
|
||||
import { BaseComponentBuilder } from './Base';
|
||||
import { fromComponent } from './index';
|
||||
|
@ -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 path from 'node:path';
|
||||
import { type UsingClient, throwError, type RawFile } from '..';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { APIBaseComponent, ComponentType } from 'discord-api-types/v10';
|
||||
import type { APIBaseComponent, ComponentType } from '../types';
|
||||
|
||||
export abstract class BaseComponentBuilder<
|
||||
TYPE extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>,
|
||||
|
@ -1,9 +1,4 @@
|
||||
import {
|
||||
type APIMessageComponentEmoji,
|
||||
type ButtonStyle,
|
||||
ComponentType,
|
||||
type APIButtonComponent,
|
||||
} from 'discord-api-types/v10';
|
||||
import { type APIMessageComponentEmoji, type ButtonStyle, ComponentType, type APIButtonComponent } from '../types';
|
||||
import type { EmojiResolvable } from '../common';
|
||||
import { resolvePartialEmoji } from '../structures/extra/functions';
|
||||
|
||||
|
@ -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';
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@ import {
|
||||
type APITextInputComponent,
|
||||
ComponentType,
|
||||
type TextInputStyle,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import type { RestOrArray } from '../common';
|
||||
import type { ActionRow } from './ActionRow';
|
||||
import { BaseComponentBuilder, type OptionValuesLength } from './Base';
|
||||
|
@ -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 { throwError } from '..';
|
||||
import { resolvePartialEmoji } from '../structures/extra/functions';
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
type ChannelType,
|
||||
ComponentType,
|
||||
SelectMenuDefaultValueType,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import { throwError } from '..';
|
||||
import type { EmojiResolvable, RestOrArray, ToClass } from '../common';
|
||||
import type {
|
||||
|
@ -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 { Button } from './Button';
|
||||
import { TextInput } from './Modal';
|
||||
|
10
src/cache/index.ts
vendored
10
src/cache/index.ts
vendored
@ -17,6 +17,10 @@ import { VoiceStates } from './resources/voice-states';
|
||||
import { Bans } from './resources/bans';
|
||||
|
||||
import {
|
||||
ChannelType,
|
||||
GatewayIntentBits,
|
||||
GuildMemberFlags,
|
||||
OverwriteType,
|
||||
type APIChannel,
|
||||
type APIEmoji,
|
||||
type APIGuildMember,
|
||||
@ -24,12 +28,8 @@ import {
|
||||
type APISticker,
|
||||
type APITextChannel,
|
||||
type APIUser,
|
||||
ChannelType,
|
||||
GatewayIntentBits,
|
||||
GuildMemberFlags,
|
||||
OverwriteType,
|
||||
type GatewayDispatchPayload,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import type { InternalOptions, UsingClient } from '../commands';
|
||||
import { Overwrites } from './resources/overwrites';
|
||||
import { Messages } from './resources/messages';
|
||||
|
2
src/cache/resources/bans.ts
vendored
2
src/cache/resources/bans.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIBan, GatewayGuildBanModifyDispatchData } from 'discord-api-types/v10';
|
||||
import type { APIBan, GatewayGuildBanModifyDispatchData } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildBasedResource } from './default/guild-based';
|
||||
|
2
src/cache/resources/channels.ts
vendored
2
src/cache/resources/channels.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIChannel } from 'discord-api-types/v10';
|
||||
import type { APIChannel } from '../../types';
|
||||
import { fakePromise } from '../../common';
|
||||
import type { AllChannels } from '../../structures';
|
||||
import channelFrom from '../../structures/channels';
|
||||
|
2
src/cache/resources/default/base.ts
vendored
2
src/cache/resources/default/base.ts
vendored
@ -1,6 +1,6 @@
|
||||
import type { GatewayIntentBits } from 'discord-api-types/v10';
|
||||
import type { UsingClient } from '../../../commands';
|
||||
import { fakePromise } from '../../../common';
|
||||
import type { GatewayIntentBits } from '../../../types';
|
||||
import type { Cache, ReturnCache } from '../../index';
|
||||
|
||||
export class BaseResource<T = any, S = any> {
|
||||
|
2
src/cache/resources/default/guild-based.ts
vendored
2
src/cache/resources/default/guild-based.ts
vendored
@ -1,6 +1,6 @@
|
||||
import type { GatewayIntentBits } from 'discord-api-types/v10';
|
||||
import type { UsingClient } from '../../../commands';
|
||||
import { fakePromise } from '../../../common';
|
||||
import type { GatewayIntentBits } from '../../../types';
|
||||
import type { Cache, ReturnCache } from '../../index';
|
||||
|
||||
export class GuildBasedResource<T = any, S = any> {
|
||||
|
2
src/cache/resources/default/guild-related.ts
vendored
2
src/cache/resources/default/guild-related.ts
vendored
@ -1,7 +1,7 @@
|
||||
import type { GatewayIntentBits } from 'discord-api-types/v10';
|
||||
import type { BaseClient } from '../../../client/base';
|
||||
import type { UsingClient } from '../../../commands';
|
||||
import { fakePromise } from '../../../common';
|
||||
import type { GatewayIntentBits } from '../../../types';
|
||||
import type { Cache, ReturnCache } from '../../index';
|
||||
|
||||
export class GuildRelatedResource<T = any, S = any> {
|
||||
|
2
src/cache/resources/emojis.ts
vendored
2
src/cache/resources/emojis.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIEmoji } from 'discord-api-types/v10';
|
||||
import type { APIEmoji } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildRelatedResource } from './default/guild-related';
|
||||
|
2
src/cache/resources/guilds.ts
vendored
2
src/cache/resources/guilds.ts
vendored
@ -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 { fakePromise } from '../../common';
|
||||
import { BaseResource } from './default/base';
|
||||
|
2
src/cache/resources/members.ts
vendored
2
src/cache/resources/members.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIGuildMember } from 'discord-api-types/v10';
|
||||
import type { APIGuildMember } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildBasedResource } from './default/guild-based';
|
||||
|
2
src/cache/resources/messages.ts
vendored
2
src/cache/resources/messages.ts
vendored
@ -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 type { MessageData, ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
|
2
src/cache/resources/overwrites.ts
vendored
2
src/cache/resources/overwrites.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIOverwrite } from 'discord-api-types/v10';
|
||||
import type { APIOverwrite } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common/it/utils';
|
||||
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
||||
|
2
src/cache/resources/presence.ts
vendored
2
src/cache/resources/presence.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { GatewayPresenceUpdate } from 'discord-api-types/v10';
|
||||
import type { GatewayPresenceUpdate } from '../../types';
|
||||
import { GuildRelatedResource } from './default/guild-related';
|
||||
|
||||
export class Presences extends GuildRelatedResource<PresenceResource, GatewayPresenceUpdate> {
|
||||
|
2
src/cache/resources/roles.ts
vendored
2
src/cache/resources/roles.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIRole } from 'discord-api-types/v10';
|
||||
import type { APIRole } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildRelatedResource } from './default/guild-related';
|
||||
|
2
src/cache/resources/stage-instances.ts
vendored
2
src/cache/resources/stage-instances.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIStageInstance } from 'discord-api-types/v10';
|
||||
import type { APIStageInstance } from '../../types';
|
||||
import { GuildRelatedResource } from './default/guild-related';
|
||||
|
||||
export class StageInstances extends GuildRelatedResource<APIStageInstance, APIStageInstance> {
|
||||
|
2
src/cache/resources/stickers.ts
vendored
2
src/cache/resources/stickers.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APISticker } from 'discord-api-types/v10';
|
||||
import type { APISticker } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildRelatedResource } from './default/guild-related';
|
||||
|
2
src/cache/resources/threads.ts
vendored
2
src/cache/resources/threads.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIThreadChannel } from 'discord-api-types/v10';
|
||||
import type { APIThreadChannel } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildRelatedResource } from './default/guild-related';
|
||||
|
2
src/cache/resources/users.ts
vendored
2
src/cache/resources/users.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { APIUser } from 'discord-api-types/v10';
|
||||
import type { APIUser } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { BaseResource } from './default/base';
|
||||
|
2
src/cache/resources/voice-states.ts
vendored
2
src/cache/resources/voice-states.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { GatewayVoiceState } from 'discord-api-types/v10';
|
||||
import type { GatewayVoiceState } from '../../types';
|
||||
import type { ReturnCache } from '../..';
|
||||
import { fakePromise } from '../../common';
|
||||
import { GuildBasedResource } from './default/guild-based';
|
||||
|
@ -35,7 +35,7 @@ import {
|
||||
type MakeRequired,
|
||||
} 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 { ComponentHandler } from '../components/handler';
|
||||
import { LangsHandler } from '../langs/handler';
|
||||
|
@ -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 Awaitable,
|
||||
|
@ -1,10 +1,5 @@
|
||||
import {
|
||||
type APIInteractionResponse,
|
||||
InteractionResponseType,
|
||||
InteractionType,
|
||||
type APIInteraction,
|
||||
} from 'discord-api-types/v10';
|
||||
import { filetypeinfo } from 'magic-bytes.js';
|
||||
import { type APIInteractionResponse, InteractionResponseType, InteractionType, type APIInteraction } from '../types';
|
||||
import { filetypemime } from 'magic-bytes.js';
|
||||
import type { HttpRequest, HttpResponse } from 'uWebSockets.js';
|
||||
import { OverwrittenMimeTypes } from '../api';
|
||||
import { isBufferLike } from '../api/utils/utils';
|
||||
@ -179,14 +174,12 @@ export class HttpClient extends BaseClient {
|
||||
let contentType = file.contentType;
|
||||
|
||||
if (!contentType) {
|
||||
const [parsedType] = filetypeinfo(file.data);
|
||||
const mime = filetypemime(Buffer.from(file.data))[0];
|
||||
|
||||
if (parsedType) {
|
||||
contentType =
|
||||
OverwrittenMimeTypes[parsedType.mime as keyof typeof OverwrittenMimeTypes] ??
|
||||
parsedType.mime ??
|
||||
'application/octet-stream';
|
||||
}
|
||||
contentType =
|
||||
OverwrittenMimeTypes[mime as keyof typeof OverwrittenMimeTypes] ??
|
||||
mime ??
|
||||
'application/octet-stream';
|
||||
}
|
||||
response.append(fileKey, new Blob([file.data], { type: contentType }), file.name);
|
||||
} else {
|
||||
@ -237,14 +230,12 @@ export class HttpClient extends BaseClient {
|
||||
let contentType = file.contentType;
|
||||
|
||||
if (!contentType) {
|
||||
const [parsedType] = filetypeinfo(file.data);
|
||||
const mime = filetypemime(Buffer.from(file.data))[0];
|
||||
|
||||
if (parsedType) {
|
||||
contentType =
|
||||
OverwrittenMimeTypes[parsedType.mime as keyof typeof OverwrittenMimeTypes] ??
|
||||
parsedType.mime ??
|
||||
'application/octet-stream';
|
||||
}
|
||||
contentType =
|
||||
OverwrittenMimeTypes[mime as keyof typeof OverwrittenMimeTypes] ??
|
||||
mime ??
|
||||
'application/octet-stream';
|
||||
}
|
||||
response.append(fileKey, new Blob([file.data], { type: contentType }), file.name);
|
||||
} else {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ChannelType } from 'discord-api-types/v10';
|
||||
import type { ChannelType } from '../types';
|
||||
import { type CustomStructures, OptionResolver } from '../commands';
|
||||
import {
|
||||
AnonymousGuild,
|
||||
@ -30,7 +30,7 @@ import {
|
||||
Webhook,
|
||||
WebhookMessage,
|
||||
} from '../structures';
|
||||
import type { StructStates } from '../common/types/util';
|
||||
import type { StructStates } from '../common/';
|
||||
import { GuildBan } from '../structures/GuildBan';
|
||||
|
||||
export type PollStructure = InferCustomStructure<Poll, 'Poll'>;
|
||||
|
@ -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 { ApiHandler, Logger } from '..';
|
||||
import type { Cache } from '../cache';
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
type APIApplicationCommandOption,
|
||||
type APIApplicationCommandSubcommandGroupOption,
|
||||
type LocaleString,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type {
|
||||
ComponentContext,
|
||||
MenuCommandContext,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MessageFlags } from 'discord-api-types/v10';
|
||||
import { MessageFlags } from '../../types';
|
||||
import type { AllChannels, InferWithPrefix, Message, ReturnCache } from '../..';
|
||||
import type { Client, WorkerClient } from '../../client';
|
||||
import type { If, UnionToTuple, When } from '../../common';
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
ApplicationIntegrationType,
|
||||
InteractionContextType,
|
||||
LocaleString,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { magicImport, type PermissionStrings } from '../../common';
|
||||
import type { RegisteredMiddlewares } from '../decorators';
|
||||
import type { MenuCommandContext } from './menucontext';
|
||||
|
@ -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 {
|
||||
toSnakeCase,
|
||||
|
@ -1,8 +1,4 @@
|
||||
import {
|
||||
ApplicationCommandOptionType,
|
||||
type APIApplicationCommandOptionChoice,
|
||||
type ChannelType,
|
||||
} from 'discord-api-types/v10';
|
||||
import { ApplicationCommandOptionType, type APIApplicationCommandOptionChoice, type ChannelType } from '../../types';
|
||||
import type {
|
||||
AutocompleteCallback,
|
||||
MenuCommandContext,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { ChannelType } from 'discord-api-types/v10';
|
||||
import type { BaseClient } from '../../client/base';
|
||||
import type { IsStrictlyUndefined } from '../../common';
|
||||
import type { ChannelType } from '../../types';
|
||||
import type { RegisteredMiddlewares } from '../decorators';
|
||||
|
||||
export type OKFunction<T> = (value: T) => void;
|
||||
|
@ -4,7 +4,7 @@ import {
|
||||
InteractionContextType,
|
||||
PermissionFlagsBits,
|
||||
type LocaleString,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import type { FlatObjectKeys, PermissionStrings } from '../common';
|
||||
import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat';
|
||||
import type { DefaultLocale, ExtraProps, IgnoreCommand, MiddlewareContext } from './applications/shared';
|
||||
|
@ -7,9 +7,9 @@ import {
|
||||
InteractionContextType,
|
||||
type APIApplicationCommandInteractionDataOption,
|
||||
ApplicationCommandOptionType,
|
||||
ChannelType,
|
||||
type APIInteractionDataResolvedChannel,
|
||||
} from 'discord-api-types/v10';
|
||||
ChannelType,
|
||||
} from '../types';
|
||||
import {
|
||||
Command,
|
||||
type ContextOptionsResolved,
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
type APIApplicationCommandSubcommandGroupOption,
|
||||
type APIApplicationCommandChannelOption,
|
||||
type LocalizationMap,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import { basename, dirname } from 'node:path';
|
||||
import type { Logger, MakeRequired, NulleableCoalising, OmitInsert } from '../common';
|
||||
import { BaseHandler } from '../common';
|
||||
@ -50,7 +50,7 @@ export class CommandHandler extends BaseHandler {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
type APIRole,
|
||||
type APIUser,
|
||||
ApplicationCommandOptionType,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import { Attachment } from '..';
|
||||
import type { MakeRequired } from '../common';
|
||||
import type { AllChannels } from '../structures';
|
||||
|
@ -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 { ApiHandler, Router } from '../../api';
|
||||
import { BaseClient, type InternalRuntimeConfig } from '../../client/base';
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
RESTGetAPIGuildBansQuery,
|
||||
RESTPostAPIGuildBulkBanJSONBody,
|
||||
RESTPutAPIGuildBanJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { BaseShorter } from './base';
|
||||
import { Transformers } from '../../client/transformers';
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
import {
|
||||
type APIChannel,
|
||||
PermissionFlagsBits,
|
||||
type RESTGetAPIChannelMessagesQuery,
|
||||
type RESTPatchAPIChannelJSONBody,
|
||||
type RESTPostAPIChannelThreadsJSONBody,
|
||||
type RESTPostAPIGuildForumThreadsJSONBody,
|
||||
type ChannelType,
|
||||
type APIGuildChannel,
|
||||
} from 'discord-api-types/v10';
|
||||
import type {
|
||||
APIChannel,
|
||||
RESTGetAPIChannelMessagesQuery,
|
||||
RESTPatchAPIChannelJSONBody,
|
||||
RESTPostAPIChannelThreadsJSONBody,
|
||||
RESTPostAPIGuildForumThreadsJSONBody,
|
||||
APIGuildChannel,
|
||||
} from '../../types';
|
||||
import { BaseChannel, type GuildRole, type GuildMember } from '../../structures';
|
||||
import channelFrom, { type AllChannels } from '../../structures/channels';
|
||||
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
||||
@ -15,6 +13,7 @@ import { BaseShorter } from './base';
|
||||
import { MergeOptions } from '../it/utils';
|
||||
import { type MessageStructure, Transformers } from '../../client/transformers';
|
||||
import type { MakeRequired } from '../types/util';
|
||||
import { type ChannelType, PermissionFlagsBits } from '../../types';
|
||||
|
||||
export class ChannelShorter extends BaseShorter {
|
||||
/**
|
||||
|
@ -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 type { ImageResolvable } from '../types/resolvables';
|
||||
import type { OmitInsert } from '../types/util';
|
||||
|
@ -10,7 +10,7 @@ import type {
|
||||
RESTPostAPIAutoModerationRuleJSONBody,
|
||||
RESTPostAPIGuildChannelJSONBody,
|
||||
RESTPostAPIGuildsJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { resolveFiles } from '../../builders';
|
||||
import { BaseChannel, Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures';
|
||||
import channelFrom from '../../structures/channels';
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { FormattingPatterns } from 'discord-api-types/globals';
|
||||
import type {
|
||||
APIGuildMember,
|
||||
RESTGetAPIGuildMembersQuery,
|
||||
RESTGetAPIGuildMembersSearchQuery,
|
||||
RESTPatchAPIGuildMemberJSONBody,
|
||||
RESTPutAPIGuildBanJSONBody,
|
||||
RESTPutAPIGuildMemberJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
import {
|
||||
type APIGuildMember,
|
||||
type RESTGetAPIGuildMembersQuery,
|
||||
type RESTGetAPIGuildMembersSearchQuery,
|
||||
type RESTPatchAPIGuildMemberJSONBody,
|
||||
type RESTPutAPIGuildBanJSONBody,
|
||||
type RESTPutAPIGuildMemberJSONBody,
|
||||
FormattingPatterns,
|
||||
} from '../../types';
|
||||
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
||||
import type { GuildMemberResolvable } from '../types/resolvables';
|
||||
import { BaseShorter } from './base';
|
||||
|
@ -2,7 +2,7 @@ import type {
|
||||
RESTPatchAPIChannelMessageJSONBody,
|
||||
RESTPostAPIChannelMessageJSONBody,
|
||||
RESTPostAPIChannelMessagesThreadsJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { resolveFiles } from '../../builders';
|
||||
import { MessagesMethods } from '../../structures';
|
||||
|
||||
|
@ -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 type { EmojiResolvable } from '../types/resolvables';
|
||||
import { BaseShorter } from './base';
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
RESTPatchAPIGuildRoleJSONBody,
|
||||
RESTPatchAPIGuildRolePositionsJSONBody,
|
||||
RESTPostAPIGuildRoleJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { BaseShorter } from './base';
|
||||
import { Transformers } from '../../client/transformers';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from 'discord-api-types/v10';
|
||||
import type { RESTPatchAPIGuildTemplateJSONBody, RESTPostAPIGuildTemplatesJSONBody } from '../../types';
|
||||
import { BaseShorter } from './base';
|
||||
import { Transformers } from '../../client/transformers';
|
||||
|
||||
|
@ -6,7 +6,7 @@ import type {
|
||||
RESTPostAPIChannelMessagesThreadsJSONBody,
|
||||
RESTPostAPIChannelThreadsJSONBody,
|
||||
RESTPostAPIGuildForumThreadsJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import channelFrom from '../../structures/channels';
|
||||
import { BaseShorter } from './base';
|
||||
import type { MakeRequired, When } from '../types/util';
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
RESTPatchAPIWebhookWithTokenJSONBody,
|
||||
RESTPostAPIChannelWebhookJSONBody,
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { resolveFiles } from '../../builders';
|
||||
import {
|
||||
MessagesMethods,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { APIPartialEmoji } from 'discord-api-types/v10';
|
||||
import type { APIPartialEmoji } from '../../types';
|
||||
import type { EmbedColors } from '..';
|
||||
import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders';
|
||||
import type { GuildMember } from '../../structures';
|
||||
|
@ -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 (
|
||||
...args: any[]
|
||||
|
@ -10,7 +10,7 @@ import type {
|
||||
RESTPatchAPIWebhookWithTokenMessageJSONBody,
|
||||
RESTPostAPIChannelMessageJSONBody,
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import type { RawFile } from '../../api';
|
||||
import type {
|
||||
ActionRow,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { APIMessageActionRowComponent, ComponentType } from 'discord-api-types/v10';
|
||||
import type { APIMessageActionRowComponent, ComponentType } from '../types';
|
||||
import { BaseComponent } from './BaseComponent';
|
||||
import type { ActionRowMessageComponents } from './index';
|
||||
import { componentFactory } from './index';
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
type APITextInputComponent,
|
||||
type APIUserSelectComponent,
|
||||
ComponentType,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import { fromComponent } from '../builders';
|
||||
|
||||
export class BaseComponent<T extends ComponentType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseComponent } from './BaseComponent';
|
||||
|
||||
export type APISelectMenuComponentTypes =
|
||||
|
@ -4,7 +4,7 @@ import type {
|
||||
APIButtonComponentWithURL,
|
||||
ButtonStyle,
|
||||
ComponentType,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import { Button } from '../builders';
|
||||
import { BaseComponent } from './BaseComponent';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
|
||||
|
||||
export class ChannelSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.ChannelSelect> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
|
||||
|
||||
export class MentionableSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.MentionableSelect> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
|
||||
|
||||
export class RoleSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.RoleSelect> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
|
||||
|
||||
export class StringSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.StringSelect> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseComponent } from './BaseComponent';
|
||||
|
||||
export class TextInputComponent extends BaseComponent<ComponentType.TextInput> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentType } from 'discord-api-types/v10';
|
||||
import type { ComponentType } from '../types';
|
||||
import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
|
||||
|
||||
export class UserSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.UserSelect> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ComponentType } from 'discord-api-types/v10';
|
||||
import { ComponentType } from '../types';
|
||||
import type { ContextComponentCommandInteractionMap, ComponentContext } from './componentcontext';
|
||||
import type { ExtraProps, RegisteredMiddlewares, UsingClient } from '../commands';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ComponentType, MessageFlags } from 'discord-api-types/v10';
|
||||
import { ComponentType, MessageFlags } from '../types';
|
||||
import type {
|
||||
AllChannels,
|
||||
ButtonInteraction,
|
||||
|
@ -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 { ButtonComponent, LinkButtonComponent, SKUButtonComponent } from './ButtonComponent';
|
||||
import { ChannelSelectMenuComponent } from './ChannelSelectMenuComponent';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MessageFlags } from 'discord-api-types/v10';
|
||||
import { MessageFlags } from '../types';
|
||||
import type { AllChannels, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..';
|
||||
import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
|
||||
import { BaseContext } from '../commands/basecontext';
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
GatewayMessageCreateDispatch,
|
||||
GatewayMessageDeleteBulkDispatch,
|
||||
GatewayMessageDeleteDispatch,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../types';
|
||||
import type { Client, WorkerClient } from '../client';
|
||||
import { BaseHandler, ReplaceRegex, magicImport, type MakeRequired, type SnakeCase } from '../common';
|
||||
import type { ClientEvents } from '../events/hooks';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from 'discord-api-types/v10';
|
||||
import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../types';
|
||||
import { toCamelCase } from '../../common';
|
||||
import type { UsingClient } from '../../commands';
|
||||
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
GatewayAutoModerationRuleCreateDispatchData,
|
||||
GatewayAutoModerationRuleDeleteDispatchData,
|
||||
GatewayAutoModerationRuleUpdateDispatchData,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { toCamelCase } from '../../common';
|
||||
import type { UsingClient } from '../../commands';
|
||||
import { Transformers } from '../../client/transformers';
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
GatewayChannelDeleteDispatchData,
|
||||
GatewayChannelPinsUpdateDispatchData,
|
||||
GatewayChannelUpdateDispatchData,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
|
||||
import { toCamelCase } from '../../common';
|
||||
import type { AllChannels } from '../../structures';
|
||||
|
@ -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 { Transformers } from '../../client/transformers';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { APIEntitlement } from 'discord-api-types/v10';
|
||||
import type { APIEntitlement } from '../../types';
|
||||
import { toCamelCase } from '../../common';
|
||||
import type { UsingClient } from '../../commands';
|
||||
|
||||
|
@ -20,7 +20,7 @@ import type {
|
||||
GatewayGuildScheduledEventUserRemoveDispatchData,
|
||||
GatewayGuildStickersUpdateDispatchData,
|
||||
GatewayGuildUpdateDispatchData,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { toCamelCase } from '../../common';
|
||||
import type { UsingClient } from '../../commands';
|
||||
import {
|
||||
|
@ -2,7 +2,7 @@ import type {
|
||||
GatewayIntegrationCreateDispatchData,
|
||||
GatewayIntegrationDeleteDispatchData,
|
||||
GatewayIntegrationUpdateDispatchData,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { toCamelCase } from '../../common';
|
||||
import type { UsingClient } from '../../commands';
|
||||
import { Transformers } from '../../client/transformers';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { GatewayInteractionCreateDispatchData } from 'discord-api-types/v10';
|
||||
import type { GatewayInteractionCreateDispatchData } from '../../types';
|
||||
import { BaseInteraction } from '../../structures';
|
||||
import type { UsingClient } from '../../commands';
|
||||
|
||||
|
@ -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 { toCamelCase } from '../../common';
|
||||
|
||||
|
@ -9,7 +9,7 @@ import type {
|
||||
GatewayMessageReactionRemoveDispatchData,
|
||||
GatewayMessageReactionRemoveEmojiDispatchData,
|
||||
GatewayMessageUpdateDispatchData,
|
||||
} from 'discord-api-types/v10';
|
||||
} from '../../types';
|
||||
import { type MakeRequired, type PartialClass, toCamelCase, type ObjectToLower } from '../../common';
|
||||
import type { UsingClient } from '../../commands';
|
||||
import { type MessageStructure, Transformers } from '../../client/transformers';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { GatewayPresenceUpdateDispatchData } from 'discord-api-types/v10';
|
||||
import type { GatewayPresenceUpdateDispatchData } from '../../types';
|
||||
import type { UsingClient } from '../../commands';
|
||||
import { toCamelCase } from '../../common';
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user