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
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!
This has been fixed as of https://github.com/discordjs/discord.js/commit/748555036db31555593fdd65023dfe4096acf27a
Most helpful comment
Ignoring the snakes blatant trolling, the type for
rateLimitPerUserseems 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:
That should solve it. And nice catch!