add embed support! (#894)

* add embed support!

* document message embeds

* make gawdl3y happy

* make edit great again

* make docs better

* Update Message.js

* Update TextBasedChannel.js

* Update TextBasedChannel.js
This commit is contained in:
Gus Caplan
2016-11-13 00:05:13 -06:00
committed by Schuyler Cebulskie
parent ee3a03f707
commit 27270a3bad
3 changed files with 19 additions and 10 deletions

View File

@@ -340,9 +340,16 @@ class Message {
return this.mentions.users.has(data) || this.mentions.channels.has(data) || this.mentions.roles.has(data);
}
/**
* Options that can be passed into editMessage
* @typedef {Object} MessageEditOptions
* @property {Object} [embed] An embed to be added/edited
*/
/**
* Edit the content of the message
* @param {StringResolvable} content The new content for the message
* @param {MessageEditOptions} [options={}] The options to provide
* @returns {Promise<Message>}
* @example
* // update the content of a message
@@ -350,8 +357,8 @@ class Message {
* .then(msg => console.log(`Updated the content of a message from ${msg.author}`))
* .catch(console.error);
*/
edit(content) {
return this.client.rest.methods.updateMessage(this, content);
edit(content, options = {}) {
return this.client.rest.methods.updateMessage(this, content, options);
}
/**

View File

@@ -28,6 +28,8 @@ class TextBasedChannel {
* @typedef {Object} MessageOptions
* @property {boolean} [tts=false] Whether or not the message should be spoken aloud
* @property {string} [nonce=''] The nonce for the message
* @property {Object} [embed] An embed for the message
* (see [here](https://discordapp.com/developers/docs/resources/channel#embed-object) for more details)
* @property {boolean} [disableEveryone=this.client.options.disableEveryone] Whether or not @everyone and @here
* should be replaced with plain-text
* @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if