extremeley weird issue with closing DM's between bot and user
I've been trying to solve this for the past 3 days
1. I have a function which makes the bot question the user on DM's
2. In order to prevent having users be questioned about 2 things at once, the function checks for an open DM channel with the user before starting, and also closes the channel with
channel.delete()
once the questioning process is done
3. I have 2 commands that use this function
4. Command A executes 100% properly
5. Although when i execute command B first, and then try executing A, the function will not fire even though it should have closed the previous DM channel2 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Post the full error stack trace, not just the top part!
- Show your code!
- Explain what exactly your issue is.
- Not a discord.js issue? Check out #useful-servers.
- Issue solved? Press the button!using command A to trigger the function works exactly as it should, while if i execute B first, none of the commands will fire after that due to there being an open DM with the bot, and the user who triggered the command
which is very weird because those 2 commands use literally the same module and call the same function, with almost identical arguments
it cant be the last thing as the function is getting triggered by the commands
just so its clear im having one function, that can be triggered by two different commands
i know, one second
thats pretty much the whole questioning function
in the for loop?
i dont see how would it affect my problem, its not an issue with the loop
(i replaced it)
nowhere i think, its only there to iterate through
questions
which is an array
its value is about the actual issue though
yes
i have
it points to the previously used channel
i just removed it here xd
command A
i know, but it doesnt cause any problems. I can execute command A, the function will start and the bot will begin asking me questions on DM's, and if i try to execute command A before finishing or cancelling the first questioning, the program wont let me
once i finish or cancel i will be able to execute it again
(i think im gonna paste B onto pastebin or something because its a lengthy eyesore)
so i should
?
in the function
i tried it before and it didnt help lol
should i delete the channel after every interaction.user.send(…)
?
actually wouldnt i have to do that every time i dm someone, so the system doesnt break
yeah im starting to think this may not be the optimal solution
okay you were right
its fixed now
and i will definetely try this
thanks a lot^^