backport: rateLimitPerUser (#2874)

This commit is contained in:
Isabella
2018-10-03 17:21:26 -05:00
committed by GitHub
parent e0f522a745
commit 1e85887229
3 changed files with 20 additions and 0 deletions

View File

@@ -36,6 +36,12 @@ class TextChannel extends GuildChannel {
* @type {?Snowflake}
*/
this.lastMessageID = data.last_message_id;
/**
* The ratelimit per user for this channel
* @type {number}
*/
this.rateLimitPerUser = data.rate_limit_per_user || 0;
}
/**
@@ -97,6 +103,16 @@ class TextChannel extends GuildChannel {
}
}
/**
* Sets the rate limit per user for this channel.
* @param {number} rateLimitPerUser The new ratelimit
* @param {string} [reason] Reason for changing the channel's ratelimits
* @returns {Promise<TextChannel>}
*/
setRateLimitPerUser(rateLimitPerUser, reason) {
return this.edit({ rateLimitPerUser }, reason);
}
// These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */
send() { }