Allow Message#edit to accept a MessageEmbed as options parameter (#1844)

This commit is contained in:
SpaceEEC
2017-08-28 03:05:34 +02:00
committed by Crawl
parent 65d9d46a3c
commit b7c55f02c2

View File

@@ -354,7 +354,7 @@ class Message extends Base {
/**
* Edit the content of 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>}
* @example
* // Update the content of a message
@@ -369,6 +369,8 @@ class Message extends Base {
} else if (!options) {
options = {};
}
if (options instanceof Embed) options = { embed: options };
if (typeof options.content !== 'undefined') content = options.content;
if (typeof content !== 'undefined') content = Util.resolveString(content);