mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 23:21:04 +00: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:
parent
948a18dfe2
commit
83b33c5046
2 changed files with 14 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue