mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
feat(TextChannel): RateLimitPerUser (#2811)
* feat: Add TextChannel#rateLimitPerUser Rename parameter in TextChannel#setRateLimitPerUser feat: Add `rateLimitPerUser` param to ChannelData fix: eslint * docs: Updated typings * fix: Requested changes * fix: rateLimitPerUser being undefined when 0 When `rate_limit_per_user` is 0, the gateway does not send it (but REST does). When this is set to a non-zero number, this property starts to exist. Otherwise this will be `0`. Adding `|| 0` should do the trick changing `undefined` to `0`. * fix: eslint
This commit is contained in:
@@ -286,6 +286,7 @@ class GuildChannel extends Channel {
|
||||
* Lock the permissions of the channel to what the parent's permissions are
|
||||
* @property {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [permissionOverwrites]
|
||||
* Permission overwrites for the channel
|
||||
* @property {number} [rateLimitPerUser] The ratelimit per user for the channel
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -323,6 +324,7 @@ class GuildChannel extends Channel {
|
||||
user_limit: typeof data.userLimit !== 'undefined' ? data.userLimit : this.userLimit,
|
||||
parent_id: data.parentID,
|
||||
lock_permissions: data.lockPermissions,
|
||||
rate_limit_per_user: data.rateLimitPerUser,
|
||||
permission_overwrites,
|
||||
},
|
||||
reason,
|
||||
|
||||
Reference in New Issue
Block a user