Retrieving GuildChannel#setName ratelimit

Hi, I was wondering if there's any way to tell whether I'm being ratelimited from renaming a particular channel or not when I'm doing setName. It would be really helpful because I have a ticket system that renames the channel when the ticket gets closed/reopen/transferred and sometime happens that it gets triggered more than 2 times per 10 minutes and I'd like to inform the user about this ratelimiting without needing to implement an internal timer if possible. Thanks in advance
5 Replies
d.js toolkit
d.js toolkit2w ago
Samtino
Samtino2w ago
Rate limits are logged through the rest event rest.on("rateLimited", console.log)
d.js docs
d.js docs2w ago
:interface: RateLimitData discord.js@14.24.2 Data emitted on RESTEvents.RateLimited :propertysignature: ClientOptions#rest discord.js@14.24.2 Options for the REST manager
Miky88
Miky88OP2w ago
I tried this but this was not the error I was expecting
node:events:497
throw er; // Unhandled 'error' event
^

TypeError: options.rejectOnRateLimit.some is not a function
at onRateLimit (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:302:148)
at SequentialHandler.runRequest (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:1115:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SequentialHandler.queueRequest (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:994:14)
at async _REST.request (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:1307:22)
at async GuildChannelManager.edit (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\discord.js\src\managers\GuildChannelManager.js:315:21)
at async Tickets.closeTicket (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\modules\Tickets.js:1165:9)
at async Tickets.interactionCreate (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\modules\Tickets.js:1610:37)
at async BotClient.<anonymous> (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\structures\ModuleManager.js:80:33)
Emitted 'error' event on BotClient instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:92:21)

Node.js v22.20.0
node:events:497
throw er; // Unhandled 'error' event
^

TypeError: options.rejectOnRateLimit.some is not a function
at onRateLimit (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:302:148)
at SequentialHandler.runRequest (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:1115:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SequentialHandler.queueRequest (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:994:14)
at async _REST.request (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\@discordjs\rest\dist\index.js:1307:22)
at async GuildChannelManager.edit (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\node_modules\discord.js\src\managers\GuildChannelManager.js:315:21)
at async Tickets.closeTicket (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\modules\Tickets.js:1165:9)
at async Tickets.interactionCreate (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\modules\Tickets.js:1610:37)
at async BotClient.<anonymous> (C:\Users\mikyo\Desktop\Work\FlexdojoDiscordBot\structures\ModuleManager.js:80:33)
Emitted 'error' event on BotClient instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:92:21)

Node.js v22.20.0
oh nvm I have to pass an array what should I pass to it? docs aren't really clear tbf Ok I figured out that ["/channels"] should be good. Thanks for the help
d.js toolkit
d.js toolkit2w ago
The issue has been marked as solved by support staff

Did you find this page helpful?