refactor(MessageEmbed): remove files (#5813)

* refactor(MessageEmbed): remove files

* fix: test
This commit is contained in:
Jan
2021-06-11 22:36:31 +02:00
committed by GitHub
parent a7ebb2145c
commit e3e466d3e5
4 changed files with 2 additions and 42 deletions

3
typings/index.d.ts vendored
View File

@@ -1366,7 +1366,6 @@ declare module 'discord.js' {
public readonly createdAt: Date | null;
public description: string | null;
public fields: EmbedField[];
public files: (MessageAttachment | string | FileOptions)[];
public footer: MessageEmbedFooter | null;
public readonly hexColor: string | null;
public image: MessageEmbedImage | null;
@@ -1381,7 +1380,6 @@ declare module 'discord.js' {
public readonly video: MessageEmbedVideo | null;
public addField(name: string, value: string, inline?: boolean): this;
public addFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
public attachFiles(file: (MessageAttachment | FileOptions | string)[]): this;
public setAuthor(name: string, iconURL?: string, url?: string): this;
public setColor(color: ColorResolvable): this;
public setDescription(description: string): this;
@@ -3277,7 +3275,6 @@ declare module 'discord.js' {
timestamp?: Date | number;
color?: ColorResolvable;
fields?: EmbedFieldData[];
files?: (MessageAttachment | string | FileOptions)[];
author?: Partial<MessageEmbedAuthor> & { icon_url?: string; proxy_icon_url?: string };
thumbnail?: Partial<MessageEmbedThumbnail> & { proxy_url?: string };
image?: Partial<MessageEmbedImage> & { proxy_url?: string };

View File

@@ -39,7 +39,7 @@ client.on('message', ({ channel }) => {
const attachment = new MessageAttachment('file.png');
const embed = new MessageEmbed();
assertIsMessage(channel.send({ files: [attachment] }));
assertIsMessage(channel.send(embed));
assertIsMessage(channel.send({ embed }));
assertIsMessage(channel.send({ embed, files: [attachment] }));
assertIsMessageArray(channel.send({ split: true }));