.setParent not working after channel name change limits kick in
Hello, I'm new to coding so bear with me.
Does anyone know if there's limits to moving channels with
.setParent
?
I'm trying to create a ticket bot, however once the channel name changing limit kicks in (2 changes per 10 minutes from closing/reopening the ticket), I can't use .setParent
anymore and the channel doesn't move.
I've been stuck trying to figure this out for 2 days (I'm new to coding entirely)8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!You can use <GuildChannel>.edit() instead and do both things in the same API call
Interesting, thank you; I'll give that a try - I currently do both separately each time it's opened or closed
Yeah, that's twice as many API calls
The issue I now run into with this, is that it resets the entire channel permissions instead of just one specific member.
Wouldn't it cause more issues trying to configure the entire channels permissions over again when I just need to edit one person within it?
Seems I was looking at it the wrong way; doing it this way has worked as I initially intended it to (in regards to modifying permissions)
However, it seems once the limiting kicks in for the channel name changes - I can't figure my way around it to continue the rest of the changes and ignore the name change.
I'll include my code for the function I've created to do these changes, please keep in mind I'm new to this if it looks horrendous.
(the code doesn't do any of the instructions in
await channel.edit
after the limiting has triggered for channel renaming
I added the code below as well, I read through this discord and online to try this to log the rate limiting information but it doesn't output anything to the console once I've triggered it.
It's definitely that though, as after I've triggered it by changing the channel name twice; it will complete the code after 10 minutes has passed
Thank you, was everything else for the rate limit portion correct?
After adding the change you mentioned, it still doesn't seem to output anything despite the rate limit being triggered
I added this under where by bot starts:
My package file has "discord.js": "^14.14.1"
and the client is correct
I've been trying to solve this for a few days on my own before I decided to ask for help here; cannot figure it out for the life of me
I am, all the code works as intended up until the rate limit is triggered, at which point it stops entirely.
In the code below, it reaches the console log Ticket Close Try
then stops completely; once 10 minutes passes it will finish where it left off.
I put this inside of my app.js, where the rest of all my code is; is that what you want?Alright, one moment - apologies in advance because it will most likely look confusing to someone other than myself
Forgive me, I'd like to make sure I do this correctly.
So I need to add
into the client
and where exactly would I want to place the console log? Above my channel.edit attempt?
My end goal of this essentially would be to add something for when this limiting does happen, I can handle that in a different way than queuing it for later
I just read that I need to know what type of "limit" it is in order to try and do that
I wasn't able to log anything so I couldn't figure out what to do with it
When I ran it like this, I had "true 1" output in the console (before the channel.edit) and it didn't do any of the edits like you said
It logged once immediately, despite the limit not being reached (but ran the code)
It logs once every time
No, I don't
by hang do you mean stop running the code?
It outputs the "true 1" message every time, but only stops the code once the limit is triggered
Sorry I think I'm explaining myself poorly
Once the limit is triggered, it now skips over the channel.edit
After commenting that, it stops the code once it outputs true 1
If by twice you mean:
true 1
true 1
No, it does not
It outputs true 1 each time I close/reopen, then on the attempt when the limit is triggered it outputs true 1 and stops completely
Right, will do
Sorry, I'm poor at explaining myself lol
This is closing and reopening until the limit triggers
I do, it does seem silly but as I'm new to this I'm trying to make sure I understand what's happening when I go through and fix things
Doing my best to learn myself before trying to get help (like this) - but I've been stuck for days
In my code, my end goal is that if this limit is triggered, I will be doing the same channel.edit but removing the portion that changes the name to respect the limit
Is there some sort of other way to do this? My impression that it was possible is the popular ticket tool bot can close/reopen tickets (and rename) twice, then it only does permission setting and channel moving
unless that'd need to be done outside of a channel.edit instead
I'm not sure I understand then; when I open/close tickets using tickettool.xyz, I can (seemingly infinitely) reopen/close tickets in quick succession, the only thing that stops working is once its been done twice the channel name no longer changes but the rest continues immediately