Added MessageOptions to the docs and added an options param to sendTTSMessage (#555)

* Added MessageOptions to the docs and added an options param to sendTTSMessage

* Docs
This commit is contained in:
Hackzzila
2016-08-27 17:06:14 -05:00
committed by Amish Shah
parent 948a18dfe2
commit 83b33c5046
2 changed files with 14 additions and 3 deletions

View File

@@ -30,6 +30,16 @@ class TextBasedChannel {
const messageIDs = messages.map(m => m.id);
return this.client.rest.methods.bulkDeleteMessages(this, messageIDs);
}
/**
* Options that can be passed into sendMessage or sendTTSMessage:
* ```js
* {
* tts: false,
* nonce: '',
* };
* ```
* @typedef {Object} MessageOptions
*/
/**
* Send a message to this channel
* @param {String} content the content to send
@@ -47,6 +57,7 @@ class TextBasedChannel {
/**
* Send a text-to-speech message to this channel
* @param {String} content the content to send
* @param {MessageOptions} [options={}] the options to provide
* @returns {Promise<Message>}
* @example
* // send a TTS message
@@ -54,8 +65,8 @@ class TextBasedChannel {
* .then(message => console.log(`Sent tts message: ${message.content}`))
* .catch(console.log);
*/
sendTTSMessage(content) {
return this.client.rest.methods.sendMessage(this, content, true);
sendTTSMessage(content, options = {}) {
return this.client.rest.methods.sendMessage(this, content, true, options.nonce);
}
/**