mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Allow Message#edit to accept a MessageEmbed as options parameter (#1844)
This commit is contained in:
@@ -354,7 +354,7 @@ class Message extends Base {
|
|||||||
/**
|
/**
|
||||||
* Edit the content of the message.
|
* Edit the content of the message.
|
||||||
* @param {StringResolvable} [content] The new content for the message
|
* @param {StringResolvable} [content] The new content for the message
|
||||||
* @param {MessageEditOptions} [options] The options to provide
|
* @param {MessageEditOptions|MessageEmbed} [options] The options to provide
|
||||||
* @returns {Promise<Message>}
|
* @returns {Promise<Message>}
|
||||||
* @example
|
* @example
|
||||||
* // Update the content of a message
|
* // Update the content of a message
|
||||||
@@ -369,6 +369,8 @@ class Message extends Base {
|
|||||||
} else if (!options) {
|
} else if (!options) {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options instanceof Embed) options = { embed: options };
|
||||||
|
|
||||||
if (typeof options.content !== 'undefined') content = options.content;
|
if (typeof options.content !== 'undefined') content = options.content;
|
||||||
|
|
||||||
if (typeof content !== 'undefined') content = Util.resolveString(content);
|
if (typeof content !== 'undefined') content = Util.resolveString(content);
|
||||||
|
|||||||
Reference in New Issue
Block a user