Discord.js v13.7

This commit is contained in:
March 7th
2022-05-14 15:06:15 +07:00
parent fc7f02e85b
commit c201e7da69
83 changed files with 4232 additions and 1162 deletions

View File

@@ -725,6 +725,7 @@ class Message extends Base {
/**
* Pins this message to the channel's pinned messages.
* @param {string} [reason] Reason for pinning
* @returns {Promise<Message>}
* @example
* // Pin a message
@@ -732,14 +733,15 @@ class Message extends Base {
* .then(console.log)
* .catch(console.error)
*/
async pin() {
async pin(reason) {
if (!this.channel) throw new Error('CHANNEL_NOT_CACHED');
await this.channel.messages.pin(this.id);
await this.channel.messages.pin(this.id, reason);
return this;
}
/**
* Unpins this message from the channel's pinned messages.
* @param {string} [reason] Reason for unpinning
* @returns {Promise<Message>}
* @example
* // Unpin a message
@@ -747,9 +749,9 @@ class Message extends Base {
* .then(console.log)
* .catch(console.error)
*/
async unpin() {
async unpin(reason) {
if (!this.channel) throw new Error('CHANNEL_NOT_CACHED');
await this.channel.messages.unpin(this.id);
await this.channel.messages.unpin(this.id, reason);
return this;
}