mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types: fix some attachment related typings (#8013)
This commit is contained in:
10
packages/discord.js/typings/index.d.ts
vendored
10
packages/discord.js/typings/index.d.ts
vendored
@@ -3971,7 +3971,7 @@ export interface CommandInteractionOption<Cached extends CacheType = CacheType>
|
||||
member?: CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>;
|
||||
channel?: CacheTypeReducer<Cached, GuildBasedChannel, APIInteractionDataResolvedChannel>;
|
||||
role?: CacheTypeReducer<Cached, Role, APIRole>;
|
||||
attachment?: AttachmentBuilder;
|
||||
attachment?: Attachment;
|
||||
message?: Message<BooleanCache<Cached>>;
|
||||
}
|
||||
|
||||
@@ -3981,7 +3981,7 @@ export interface CommandInteractionResolvedData<Cached extends CacheType = Cache
|
||||
roles?: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
|
||||
channels?: Collection<Snowflake, CacheTypeReducer<Cached, AnyChannel, APIInteractionDataResolvedChannel>>;
|
||||
messages?: Collection<Snowflake, CacheTypeReducer<Cached, Message, APIMessage>>;
|
||||
attachments?: Collection<Snowflake, AttachmentBuilder>;
|
||||
attachments?: Collection<Snowflake, Attachment>;
|
||||
}
|
||||
|
||||
export declare const Colors: {
|
||||
@@ -4707,7 +4707,7 @@ export interface MessageEditOptions {
|
||||
attachments?: JSONEncodable<AttachmentPayload>[];
|
||||
content?: string | null;
|
||||
embeds?: (JSONEncodable<APIEmbed> | APIEmbed)[] | null;
|
||||
files?: (AttachmentPayload | BufferResolvable | Stream | AttachmentBuilder)[];
|
||||
files?: (BufferResolvable | Stream | JSONEncodable<APIAttachment> | Attachment | AttachmentBuilder)[];
|
||||
flags?: BitFieldResolvable<MessageFlagsString, number>;
|
||||
allowedMentions?: MessageMentionOptions;
|
||||
components?: (
|
||||
@@ -4758,10 +4758,10 @@ export interface MessageOptions {
|
||||
| APIActionRowComponent<APIMessageActionRowComponent>
|
||||
)[];
|
||||
allowedMentions?: MessageMentionOptions;
|
||||
files?: (Attachment | AttachmentBuilder | BufferResolvable | Stream)[];
|
||||
files?: (BufferResolvable | Stream | JSONEncodable<APIAttachment> | Attachment | AttachmentBuilder)[];
|
||||
reply?: ReplyOptions;
|
||||
stickers?: StickerResolvable[];
|
||||
attachments?: (Attachment | AttachmentBuilder)[];
|
||||
attachments?: JSONEncodable<AttachmentPayload>[];
|
||||
flags?: BitFieldResolvable<Extract<MessageFlagsString, 'SuppressEmbeds'>, number>;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ import {
|
||||
ChannelMention,
|
||||
UserMention,
|
||||
PartialGroupDMChannel,
|
||||
Attachment,
|
||||
} from '.';
|
||||
import { expectAssignable, expectDeprecated, expectNotAssignable, expectNotType, expectType } from 'tsd';
|
||||
import { UnsafeButtonBuilder, UnsafeEmbedBuilder, UnsafeSelectMenuBuilder } from '@discordjs/builders';
|
||||
@@ -1491,8 +1492,8 @@ expectNotAssignable<ActionRowData<MessageActionRowComponentData>>({
|
||||
|
||||
declare const chatInputInteraction: ChatInputCommandInteraction;
|
||||
|
||||
expectType<AttachmentBuilder>(chatInputInteraction.options.getAttachment('attachment', true));
|
||||
expectType<AttachmentBuilder | null>(chatInputInteraction.options.getAttachment('attachment'));
|
||||
expectType<Attachment>(chatInputInteraction.options.getAttachment('attachment', true));
|
||||
expectType<Attachment | null>(chatInputInteraction.options.getAttachment('attachment'));
|
||||
|
||||
declare const modal: ModalBuilder;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user