mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Add message.pin() and .unpin();
This commit is contained in:
@@ -265,6 +265,22 @@ class Message {
|
||||
const newContent = this.guild ? `${this.author}, ${content}` : content;
|
||||
return this.client.rest.methods.sendMessage(this.channel, newContent, options.tts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pins this message to the channel's pinned messages
|
||||
* @returns {Promise<Message, Error>}
|
||||
*/
|
||||
pin() {
|
||||
return this.client.rest.methods.pinMessage(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpins this message from the channel's pinned messages
|
||||
* @returns {Promise<Message, Error>}
|
||||
*/
|
||||
unpin() {
|
||||
return this.client.rest.methods.unpinMessage(this);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
||||
Reference in New Issue
Block a user