mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
chore(deps): bump discord-api-types (#10841)
* chore(deps): bump discord-api-types * chore: tests * chore: tests 2 * chore: replace ImageSize type with dtypes type
This commit is contained in:
@@ -2,7 +2,7 @@ import {
|
||||
ButtonStyle,
|
||||
ComponentType,
|
||||
type APIActionRowComponent,
|
||||
type APIMessageActionRowComponent,
|
||||
type APIComponentInMessageActionRow,
|
||||
} from 'discord-api-types/v10';
|
||||
import { describe, test, expect } from 'vitest';
|
||||
import {
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
StringSelectMenuOptionBuilder,
|
||||
} from '../../src/index.js';
|
||||
|
||||
const rowWithButtonData: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
const rowWithButtonData: APIActionRowComponent<APIComponentInMessageActionRow> = {
|
||||
type: ComponentType.ActionRow,
|
||||
components: [
|
||||
{
|
||||
@@ -25,7 +25,7 @@ const rowWithButtonData: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
],
|
||||
};
|
||||
|
||||
const rowWithSelectMenuData: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
const rowWithSelectMenuData: APIActionRowComponent<APIComponentInMessageActionRow> = {
|
||||
type: ComponentType.ActionRow,
|
||||
components: [
|
||||
{
|
||||
@@ -50,7 +50,7 @@ const rowWithSelectMenuData: APIActionRowComponent<APIMessageActionRowComponent>
|
||||
describe('Action Row Components', () => {
|
||||
describe('Assertion Tests', () => {
|
||||
test('GIVEN valid JSON input THEN valid JSON output is given', () => {
|
||||
const actionRowData: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
const actionRowData: APIActionRowComponent<APIComponentInMessageActionRow> = {
|
||||
type: ComponentType.ActionRow,
|
||||
components: [
|
||||
{
|
||||
@@ -73,7 +73,7 @@ describe('Action Row Components', () => {
|
||||
});
|
||||
|
||||
test('GIVEN valid builder options THEN valid JSON output is given', () => {
|
||||
const rowWithButtonData: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
const rowWithButtonData: APIActionRowComponent<APIComponentInMessageActionRow> = {
|
||||
type: ComponentType.ActionRow,
|
||||
components: [
|
||||
{
|
||||
@@ -85,7 +85,7 @@ describe('Action Row Components', () => {
|
||||
],
|
||||
};
|
||||
|
||||
const rowWithSelectMenuData: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
const rowWithSelectMenuData: APIActionRowComponent<APIComponentInMessageActionRow> = {
|
||||
type: ComponentType.ActionRow,
|
||||
components: [
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
ComponentType,
|
||||
TextInputStyle,
|
||||
type APIButtonComponent,
|
||||
type APIMessageActionRowComponent,
|
||||
type APIComponentInMessageActionRow,
|
||||
type APISelectMenuComponent,
|
||||
type APITextInputComponent,
|
||||
type APIActionRowComponent,
|
||||
@@ -27,7 +27,7 @@ describe('createComponentBuilder', () => {
|
||||
);
|
||||
|
||||
test('GIVEN an action row component THEN returns a ActionRowBuilder', () => {
|
||||
const actionRow: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
const actionRow: APIActionRowComponent<APIComponentInMessageActionRow> = {
|
||||
components: [],
|
||||
type: ComponentType.ActionRow,
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
||||
"dependencies": {
|
||||
"@discordjs/util": "workspace:^",
|
||||
"discord-api-types": "^0.37.120",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"ts-mixer": "^6.0.4",
|
||||
"tslib": "^2.8.1",
|
||||
"zod": "^3.24.2",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import type {
|
||||
APITextInputComponent,
|
||||
APIActionRowComponent,
|
||||
APIActionRowComponentTypes,
|
||||
APIComponentInActionRow,
|
||||
APIChannelSelectComponent,
|
||||
APIMentionableSelectComponent,
|
||||
APIRoleSelectComponent,
|
||||
@@ -37,7 +37,7 @@ import { UserSelectMenuBuilder } from './selectMenu/UserSelectMenu.js';
|
||||
import { TextInputBuilder } from './textInput/TextInput.js';
|
||||
|
||||
export interface ActionRowBuilderData
|
||||
extends Partial<Omit<APIActionRowComponent<APIActionRowComponentTypes>, 'components'>> {
|
||||
extends Partial<Omit<APIActionRowComponent<APIComponentInActionRow>, 'components'>> {
|
||||
components: AnyActionRowComponentBuilder[];
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface ActionRowBuilderData
|
||||
*
|
||||
* @typeParam ComponentType - The types of components this action row holds
|
||||
*/
|
||||
export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<APIActionRowComponentTypes>> {
|
||||
export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<APIComponentInActionRow>> {
|
||||
private readonly data: ActionRowBuilderData;
|
||||
|
||||
/**
|
||||
@@ -90,7 +90,7 @@ export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<API
|
||||
* .addComponents(button2, button3);
|
||||
* ```
|
||||
*/
|
||||
public constructor({ components = [], ...data }: Partial<APIActionRowComponent<APIActionRowComponentTypes>> = {}) {
|
||||
public constructor({ components = [], ...data }: Partial<APIActionRowComponent<APIComponentInActionRow>> = {}) {
|
||||
super();
|
||||
this.data = {
|
||||
...structuredClone(data),
|
||||
@@ -328,7 +328,7 @@ export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<API
|
||||
/**
|
||||
* {@inheritDoc ComponentBuilder.toJSON}
|
||||
*/
|
||||
public override toJSON(validationOverride?: boolean): APIActionRowComponent<APIActionRowComponentTypes> {
|
||||
public override toJSON(validationOverride?: boolean): APIActionRowComponent<APIComponentInActionRow> {
|
||||
const { components, ...rest } = this.data;
|
||||
|
||||
const data = {
|
||||
@@ -338,6 +338,6 @@ export class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<API
|
||||
|
||||
validate(actionRowPredicate, data, validationOverride);
|
||||
|
||||
return data as APIActionRowComponent<APIActionRowComponentTypes>;
|
||||
return data as APIActionRowComponent<APIComponentInActionRow>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { JSONEncodable } from '@discordjs/util';
|
||||
import type { APIActionRowComponent, APIActionRowComponentTypes } from 'discord-api-types/v10';
|
||||
import type { APIActionRowComponent, APIComponentInActionRow } from 'discord-api-types/v10';
|
||||
|
||||
/**
|
||||
* Any action row component data represented as an object.
|
||||
*/
|
||||
export type AnyAPIActionRowComponent = APIActionRowComponent<APIActionRowComponentTypes> | APIActionRowComponentTypes;
|
||||
export type AnyAPIActionRowComponent = APIActionRowComponent<APIComponentInActionRow> | APIComponentInActionRow;
|
||||
|
||||
/**
|
||||
* The base component builder that contains common symbols for all sorts of components.
|
||||
|
||||
@@ -144,6 +144,36 @@ export function createComponentBuilder(
|
||||
return new MentionableSelectMenuBuilder(data);
|
||||
case ComponentType.ChannelSelect:
|
||||
return new ChannelSelectMenuBuilder(data);
|
||||
|
||||
// Will be handled later
|
||||
case ComponentType.Section: {
|
||||
throw new Error('Not implemented yet: ComponentType.Section case');
|
||||
}
|
||||
|
||||
case ComponentType.TextDisplay: {
|
||||
throw new Error('Not implemented yet: ComponentType.TextDisplay case');
|
||||
}
|
||||
|
||||
case ComponentType.Thumbnail: {
|
||||
throw new Error('Not implemented yet: ComponentType.Thumbnail case');
|
||||
}
|
||||
|
||||
case ComponentType.MediaGallery: {
|
||||
throw new Error('Not implemented yet: ComponentType.MediaGallery case');
|
||||
}
|
||||
|
||||
case ComponentType.File: {
|
||||
throw new Error('Not implemented yet: ComponentType.File case');
|
||||
}
|
||||
|
||||
case ComponentType.Separator: {
|
||||
throw new Error('Not implemented yet: ComponentType.Separator case');
|
||||
}
|
||||
|
||||
case ComponentType.Container: {
|
||||
throw new Error('Not implemented yet: ComponentType.Container case');
|
||||
}
|
||||
|
||||
default:
|
||||
// @ts-expect-error This case can still occur if we get a newer unsupported component type
|
||||
throw new Error(`Cannot properly serialize component type: ${data.type}`);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import type { JSONEncodable } from '@discordjs/util';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIModalActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APIModalInteractionResponseCallbackData,
|
||||
} from 'discord-api-types/v10';
|
||||
import { ActionRowBuilder } from '../../components/ActionRow.js';
|
||||
@@ -73,7 +73,7 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
|
||||
public addActionRows(
|
||||
...components: RestOrArray<
|
||||
| ActionRowBuilder
|
||||
| APIActionRowComponent<APIModalActionRowComponent>
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| ((builder: ActionRowBuilder) => ActionRowBuilder)
|
||||
>
|
||||
) {
|
||||
@@ -93,7 +93,7 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
|
||||
public setActionRows(
|
||||
...components: RestOrArray<
|
||||
| ActionRowBuilder
|
||||
| APIActionRowComponent<APIModalActionRowComponent>
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| ((builder: ActionRowBuilder) => ActionRowBuilder)
|
||||
>
|
||||
) {
|
||||
@@ -137,7 +137,7 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
|
||||
deleteCount: number,
|
||||
...rows: (
|
||||
| ActionRowBuilder
|
||||
| APIActionRowComponent<APIModalActionRowComponent>
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| ((builder: ActionRowBuilder) => ActionRowBuilder)
|
||||
)[]
|
||||
): this {
|
||||
|
||||
@@ -4,12 +4,13 @@ import type {
|
||||
APIAllowedMentions,
|
||||
APIAttachment,
|
||||
APIEmbed,
|
||||
APIMessageActionRowComponent,
|
||||
APIComponentInMessageActionRow,
|
||||
APIMessageReference,
|
||||
APIPoll,
|
||||
RESTPostAPIChannelMessageJSONBody,
|
||||
Snowflake,
|
||||
MessageFlags,
|
||||
APIComponentInActionRow,
|
||||
} from 'discord-api-types/v10';
|
||||
import { ActionRowBuilder } from '../components/ActionRow.js';
|
||||
import { normalizeArray, type RestOrArray } from '../util/normalizeArray.js';
|
||||
@@ -76,7 +77,10 @@ export class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJS
|
||||
attachments: data.attachments?.map((attachment) => new AttachmentBuilder(attachment)) ?? [],
|
||||
embeds: data.embeds?.map((embed) => new EmbedBuilder(embed)) ?? [],
|
||||
poll: data.poll ? new PollBuilder(data.poll) : undefined,
|
||||
components: data.components?.map((component) => new ActionRowBuilder(component)) ?? [],
|
||||
components:
|
||||
data.components?.map(
|
||||
(component) => new ActionRowBuilder(component as unknown as APIActionRowComponent<APIComponentInActionRow>),
|
||||
) ?? [],
|
||||
message_reference: data.message_reference ? new MessageReferenceBuilder(data.message_reference) : undefined,
|
||||
};
|
||||
}
|
||||
@@ -271,7 +275,7 @@ export class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJS
|
||||
public addComponents(
|
||||
...components: RestOrArray<
|
||||
| ActionRowBuilder
|
||||
| APIActionRowComponent<APIMessageActionRowComponent>
|
||||
| APIActionRowComponent<APIComponentInMessageActionRow>
|
||||
| ((builder: ActionRowBuilder) => ActionRowBuilder)
|
||||
>
|
||||
): this {
|
||||
@@ -316,7 +320,7 @@ export class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJS
|
||||
deleteCount: number,
|
||||
...components: RestOrArray<
|
||||
| ActionRowBuilder
|
||||
| APIActionRowComponent<APIMessageActionRowComponent>
|
||||
| APIActionRowComponent<APIComponentInMessageActionRow>
|
||||
| ((builder: ActionRowBuilder) => ActionRowBuilder)
|
||||
>
|
||||
): this {
|
||||
@@ -335,7 +339,7 @@ export class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJS
|
||||
public setComponents(
|
||||
...components: RestOrArray<
|
||||
| ActionRowBuilder
|
||||
| APIActionRowComponent<APIMessageActionRowComponent>
|
||||
| APIActionRowComponent<APIComponentInMessageActionRow>
|
||||
| ((builder: ActionRowBuilder) => ActionRowBuilder)
|
||||
>
|
||||
): this {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { REST } from '@discordjs/rest';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIModalActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
RESTPostAPIInteractionCallbackWithResponseResult,
|
||||
} from 'discord-api-types/v10';
|
||||
import { expectTypeOf, describe, test } from 'vitest';
|
||||
@@ -11,7 +11,7 @@ const rest = new REST();
|
||||
const api = new API(rest);
|
||||
const SNOWFLAKE = '123456789012345678' as const;
|
||||
const TOKEN = 'token' as const;
|
||||
const MODAL_COMPONENTS: APIActionRowComponent<APIModalActionRowComponent>[] = [] as const;
|
||||
const MODAL_COMPONENTS: APIActionRowComponent<APIComponentInModalActionRow>[] = [] as const;
|
||||
const boolValue = true as boolean;
|
||||
|
||||
describe('Interaction with_response overloads.', () => {
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"@discordjs/ws": "workspace:^",
|
||||
"@sapphire/snowflake": "^3.5.5",
|
||||
"@vladfrangu/async_event_emitter": "^2.4.6",
|
||||
"discord-api-types": "^0.37.120"
|
||||
"discord-api-types": "^0.38.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
"@discordjs/ws": "workspace:^",
|
||||
"@sapphire/snowflake": "3.5.5",
|
||||
"@vladfrangu/async_event_emitter": "^2.4.6",
|
||||
"discord-api-types": "^0.37.120",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"lodash.snakecase": "4.1.1",
|
||||
"tslib": "^2.8.1",
|
||||
|
||||
30
packages/discord.js/typings/index.d.ts
vendored
30
packages/discord.js/typings/index.d.ts
vendored
@@ -68,13 +68,13 @@ import {
|
||||
AuditLogEvent,
|
||||
APIMessageComponentEmoji,
|
||||
EmbedType,
|
||||
APIActionRowComponentTypes,
|
||||
APIComponentInActionRow,
|
||||
APIModalInteractionResponseCallbackData,
|
||||
APIModalSubmitInteraction,
|
||||
APIMessageActionRowComponent,
|
||||
APIComponentInMessageActionRow,
|
||||
TextInputStyle,
|
||||
APITextInputComponent,
|
||||
APIModalActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APIModalComponent,
|
||||
APISelectMenuOption,
|
||||
APIEmbedField,
|
||||
@@ -258,7 +258,7 @@ export interface BaseComponentData {
|
||||
}
|
||||
|
||||
export type MessageActionRowComponentData =
|
||||
| JSONEncodable<APIMessageActionRowComponent>
|
||||
| JSONEncodable<APIComponentInMessageActionRow>
|
||||
| ButtonComponentData
|
||||
| StringSelectMenuComponentData
|
||||
| UserSelectMenuComponentData
|
||||
@@ -266,13 +266,13 @@ export type MessageActionRowComponentData =
|
||||
| MentionableSelectMenuComponentData
|
||||
| ChannelSelectMenuComponentData;
|
||||
|
||||
export type ModalActionRowComponentData = JSONEncodable<APIModalActionRowComponent> | TextInputComponentData;
|
||||
export type ModalActionRowComponentData = JSONEncodable<APIComponentInModalActionRow> | TextInputComponentData;
|
||||
|
||||
export type ActionRowComponentData = MessageActionRowComponentData | ModalActionRowComponentData;
|
||||
|
||||
export type ActionRowComponent = MessageActionRowComponent | ModalActionRowComponent;
|
||||
|
||||
export interface ActionRowData<ComponentType extends JSONEncodable<APIActionRowComponentTypes> | ActionRowComponentData>
|
||||
export interface ActionRowData<ComponentType extends JSONEncodable<APIComponentInActionRow> | ActionRowComponentData>
|
||||
extends BaseComponentData {
|
||||
components: readonly ComponentType[];
|
||||
}
|
||||
@@ -287,9 +287,9 @@ export type MessageActionRowComponent =
|
||||
export type ModalActionRowComponent = TextInputComponent;
|
||||
|
||||
export class ActionRow<ComponentType extends MessageActionRowComponent | ModalActionRowComponent> extends Component<
|
||||
APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>
|
||||
APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>
|
||||
> {
|
||||
private constructor(data: APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>);
|
||||
private constructor(data: APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>);
|
||||
public readonly components: ComponentType[];
|
||||
public toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>;
|
||||
}
|
||||
@@ -697,7 +697,7 @@ export class ButtonInteraction<Cached extends CacheType = CacheType> extends Mes
|
||||
export type AnyComponent =
|
||||
| APIMessageComponent
|
||||
| APIModalComponent
|
||||
| APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>;
|
||||
| APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>;
|
||||
|
||||
export class Component<RawComponentData extends AnyComponent = AnyComponent> {
|
||||
public readonly data: Readonly<RawComponentData>;
|
||||
@@ -2150,9 +2150,9 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
||||
public get component(): CacheTypeReducer<
|
||||
Cached,
|
||||
MessageActionRowComponent,
|
||||
APIMessageActionRowComponent,
|
||||
MessageActionRowComponent | APIMessageActionRowComponent,
|
||||
MessageActionRowComponent | APIMessageActionRowComponent
|
||||
APIComponentInMessageActionRow,
|
||||
MessageActionRowComponent | APIComponentInMessageActionRow,
|
||||
MessageActionRowComponent | APIComponentInMessageActionRow
|
||||
>;
|
||||
public componentType: MessageComponentType;
|
||||
public customId: string;
|
||||
@@ -2354,7 +2354,7 @@ export interface ModalComponentData {
|
||||
customId: string;
|
||||
title: string;
|
||||
components: readonly (
|
||||
| JSONEncodable<APIActionRowComponent<APIModalActionRowComponent>>
|
||||
| JSONEncodable<APIActionRowComponent<APIComponentInModalActionRow>>
|
||||
| ActionRowData<ModalActionRowComponentData>
|
||||
)[];
|
||||
}
|
||||
@@ -6231,9 +6231,9 @@ export interface BaseMessageOptions {
|
||||
| AttachmentPayload
|
||||
)[];
|
||||
components?: readonly (
|
||||
| JSONEncodable<APIActionRowComponent<APIActionRowComponentTypes>>
|
||||
| JSONEncodable<APIActionRowComponent<APIComponentInActionRow>>
|
||||
| ActionRowData<MessageActionRowComponentData | MessageActionRowComponentBuilder>
|
||||
| APIActionRowComponent<APIActionRowComponentTypes>
|
||||
| APIActionRowComponent<APIComponentInActionRow>
|
||||
)[];
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
"homepage": "https://discord.js.org",
|
||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
||||
"dependencies": {
|
||||
"discord-api-types": "^0.37.120"
|
||||
"discord-api-types": "^0.38.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
"@discordjs/rest": "workspace:^",
|
||||
"@discordjs/util": "workspace:^",
|
||||
"@discordjs/ws": "workspace:^",
|
||||
"discord-api-types": "^0.37.120"
|
||||
"discord-api-types": "^0.38.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
"@sapphire/async-queue": "^1.5.5",
|
||||
"@sapphire/snowflake": "^3.5.5",
|
||||
"@vladfrangu/async_event_emitter": "^2.4.6",
|
||||
"discord-api-types": "^0.37.120",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"magic-bytes.js": "^1.10.0",
|
||||
"tslib": "^2.8.1",
|
||||
"undici": "7.8.0",
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { getUserAgentAppendix } from '@discordjs/util';
|
||||
import type { ImageSize } from 'discord-api-types/v10';
|
||||
import { APIVersion } from 'discord-api-types/v10';
|
||||
import { getDefaultStrategy } from '../../environment.js';
|
||||
import type { RESTOptions, ResponseLike } from './types.js';
|
||||
|
||||
export type { ImageSize } from 'discord-api-types/v10';
|
||||
|
||||
export const DefaultUserAgent =
|
||||
`DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])` as `DiscordBot (https://discord.js.org, ${string})`;
|
||||
|
||||
@@ -48,11 +51,12 @@ export enum RESTEvents {
|
||||
|
||||
export const ALLOWED_EXTENSIONS = ['webp', 'png', 'jpg', 'jpeg', 'gif'] as const satisfies readonly string[];
|
||||
export const ALLOWED_STICKER_EXTENSIONS = ['png', 'json', 'gif'] as const satisfies readonly string[];
|
||||
export const ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1_024, 2_048, 4_096] as const satisfies readonly number[];
|
||||
export const ALLOWED_SIZES: readonly number[] = [
|
||||
16, 32, 64, 128, 256, 512, 1_024, 2_048, 4_096,
|
||||
] satisfies readonly ImageSize[];
|
||||
|
||||
export type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
|
||||
export type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
|
||||
export type ImageSize = (typeof ALLOWED_SIZES)[number];
|
||||
|
||||
export const OverwrittenMimeTypes = {
|
||||
// https://github.com/discordjs/discord.js/issues/8557
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
||||
"dependencies": {
|
||||
"@types/ws": "^8.18.1",
|
||||
"discord-api-types": "^0.37.120",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"prism-media": "^1.3.5",
|
||||
"tslib": "^2.8.1",
|
||||
"ws": "^8.18.1"
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
"@sapphire/async-queue": "^1.5.5",
|
||||
"@types/ws": "^8.18.1",
|
||||
"@vladfrangu/async_event_emitter": "^2.4.6",
|
||||
"discord-api-types": "^0.37.120",
|
||||
"discord-api-types": "^0.38.1",
|
||||
"tslib": "^2.8.1",
|
||||
"ws": "^8.18.1"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user