mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 04:52:22 +00:00
Added message.reply (#529)
This commit is contained in:
parent
50dcececfb
commit
3a16f5147d
1 changed files with 15 additions and 0 deletions
|
|
@ -244,6 +244,21 @@ class Message {
|
|||
edit(content) {
|
||||
return this.client.rest.methods.updateMessage(this, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reply to a message
|
||||
* @param {String} content the content of the message
|
||||
* @param {MessageOptions} [options = {}] the options to provide
|
||||
* @returns {Promise<Message>}
|
||||
* @example
|
||||
* // reply to a message
|
||||
* message.reply('Hey, I'm a reply!')
|
||||
* .then(msg => console.log(`Sent a reply to ${msg.author}`))
|
||||
* .catch(console.log);
|
||||
*/
|
||||
reply(content, options = {}) {
|
||||
return this.client.rest.methods.sendMessage(this.channel, this.guild ? `${this.author}, ${content}` : content, options.tts);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
|
|
|||
Loading…
Reference in a new issue