mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Allow Message#edit to accept a RichEmbed and fixed RichEmbed#file's type (#1829)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const Mentions = require('./MessageMentions');
|
||||
const Attachment = require('./MessageAttachment');
|
||||
const Embed = require('./MessageEmbed');
|
||||
const RichEmbed = require('./RichEmbed');
|
||||
const MessageReaction = require('./MessageReaction');
|
||||
const ReactionCollector = require('./ReactionCollector');
|
||||
const Util = require('../util/Util');
|
||||
@@ -365,7 +366,7 @@ class Message {
|
||||
/**
|
||||
* Edit the content of the message.
|
||||
* @param {StringResolvable} [content] The new content for the message
|
||||
* @param {MessageEditOptions} [options] The options to provide
|
||||
* @param {MessageEditOptions|RichEmbed} [options] The options to provide
|
||||
* @returns {Promise<Message>}
|
||||
* @example
|
||||
* // Update the content of a message
|
||||
@@ -380,6 +381,7 @@ class Message {
|
||||
} else if (!options) {
|
||||
options = {};
|
||||
}
|
||||
if (options instanceof RichEmbed) options = { embed: options };
|
||||
return this.client.rest.methods.updateMessage(this, content, options);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class RichEmbed {
|
||||
|
||||
/**
|
||||
* File to upload alongside this Embed
|
||||
* @type {string}
|
||||
* @type {FileOptions|string|Attachment}
|
||||
*/
|
||||
this.file = data.file;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user