mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
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:
File diff suppressed because one or more lines are too long
@@ -30,6 +30,16 @@ class TextBasedChannel {
|
|||||||
const messageIDs = messages.map(m => m.id);
|
const messageIDs = messages.map(m => m.id);
|
||||||
return this.client.rest.methods.bulkDeleteMessages(this, messageIDs);
|
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
|
* Send a message to this channel
|
||||||
* @param {String} content the content to send
|
* @param {String} content the content to send
|
||||||
@@ -47,6 +57,7 @@ class TextBasedChannel {
|
|||||||
/**
|
/**
|
||||||
* Send a text-to-speech message to this channel
|
* Send a text-to-speech message to this channel
|
||||||
* @param {String} content the content to send
|
* @param {String} content the content to send
|
||||||
|
* @param {MessageOptions} [options={}] the options to provide
|
||||||
* @returns {Promise<Message>}
|
* @returns {Promise<Message>}
|
||||||
* @example
|
* @example
|
||||||
* // send a TTS message
|
* // send a TTS message
|
||||||
@@ -54,8 +65,8 @@ class TextBasedChannel {
|
|||||||
* .then(message => console.log(`Sent tts message: ${message.content}`))
|
* .then(message => console.log(`Sent tts message: ${message.content}`))
|
||||||
* .catch(console.log);
|
* .catch(console.log);
|
||||||
*/
|
*/
|
||||||
sendTTSMessage(content) {
|
sendTTSMessage(content, options = {}) {
|
||||||
return this.client.rest.methods.sendMessage(this, content, true);
|
return this.client.rest.methods.sendMessage(this, content, true, options.nonce);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user