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:
Kyra
2018-09-29 16:02:49 +02:00
committed by Crawl
parent 60ad9053a3
commit d4c0bb2a0d
3 changed files with 21 additions and 0 deletions

3
typings/index.d.ts vendored
View File

@@ -1045,9 +1045,11 @@ declare module 'discord.js' {
public readonly members: Collection<Snowflake, GuildMember>;
public messages: MessageStore;
public nsfw: boolean;
public rateLimitPerUser: number;
public topic: string;
public createWebhook(name: string, options?: { avatar?: BufferResolvable | Base64Resolvable, reason?: string }): Promise<Webhook>;
public setNSFW(nsfw: boolean, reason?: string): Promise<TextChannel>;
public setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<TextChannel>;
public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
}
@@ -1529,6 +1531,7 @@ declare module 'discord.js' {
bitrate?: number;
userLimit?: number;
parentID?: Snowflake;
rateLimitPerUser?: number;
lockPermissions?: boolean;
permissionOverwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
};