Discord.js: rate_limit_per_user property missing on TextChannel object

Created on 22 Sep 2019  路  8Comments  路  Source: discordjs/discord.js

Everything is in the title, I am using the webpack version of 11.5.1, the object only provides a function to set the rate limit per user in the text channel, but it does not provide the current value of that limit, or if it has a limit set at all.

Docs: https://discordapp.com/developers/docs/resources/channel#get-channel

typings bug

Most helpful comment

Ignoring the snakes blatant trolling, the type for rateLimitPerUser seems to be missing in 11.5 from the typings. (I will submit a PR to fix that to the 11.5-dev branch)

For now, to solve your compile error, please add this in your code base, just once:

declare module 'discord.js' {
    interface TextChannel {
        rateLimitPerUser: number;
    }
}

That should solve it. And nice catch!

All 8 comments

https://discord.js.org/#/docs/main/11.5.1/class/TextChannel?scrollTo=rateLimitPerUser

We have the value existent on the TextChannel object... Can you show us the object that doesn't have the value?

Well I'm not sure it does not pop up with intellisense for me, I am using a TextChannel object.

intellisense is not reality. stay in reality.

intellisense is not reality. stay in reality.

[tsl] ERROR in C:\Users\Earu\Documents\GitHub\Conduit\src\components\dashboard\guild\dashboardTextChannel.tsx(51,40) TS2339: Property 'rateLimitPerUser' does not exist on type 'TextChannel'.

typescript is not reality. stay in reality.

Ignoring the snakes blatant trolling, the type for rateLimitPerUser seems to be missing in 11.5 from the typings. (I will submit a PR to fix that to the 11.5-dev branch)

For now, to solve your compile error, please add this in your code base, just once:

declare module 'discord.js' {
    interface TextChannel {
        rateLimitPerUser: number;
    }
}

That should solve it. And nice catch!

Thanks man!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iCrawl picture iCrawl  路  3Comments

DatMayo picture DatMayo  路  3Comments

PassTheMayo picture PassTheMayo  路  3Comments

kvn1351 picture kvn1351  路  3Comments

smchase picture smchase  路  3Comments