mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +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 Mentions = require('./MessageMentions');
|
||||||
const Attachment = require('./MessageAttachment');
|
const Attachment = require('./MessageAttachment');
|
||||||
const Embed = require('./MessageEmbed');
|
const Embed = require('./MessageEmbed');
|
||||||
|
const RichEmbed = require('./RichEmbed');
|
||||||
const MessageReaction = require('./MessageReaction');
|
const MessageReaction = require('./MessageReaction');
|
||||||
const ReactionCollector = require('./ReactionCollector');
|
const ReactionCollector = require('./ReactionCollector');
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
@@ -365,7 +366,7 @@ class Message {
|
|||||||
/**
|
/**
|
||||||
* 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|RichEmbed} [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
|
||||||
@@ -380,6 +381,7 @@ class Message {
|
|||||||
} else if (!options) {
|
} else if (!options) {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
|
if (options instanceof RichEmbed) options = { embed: options };
|
||||||
return this.client.rest.methods.updateMessage(this, content, options);
|
return this.client.rest.methods.updateMessage(this, content, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class RichEmbed {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* File to upload alongside this Embed
|
* File to upload alongside this Embed
|
||||||
* @type {string}
|
* @type {FileOptions|string|Attachment}
|
||||||
*/
|
*/
|
||||||
this.file = data.file;
|
this.file = data.file;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user