Compare interaction result and DB data
Hi, I want to get DB data to compare it to an interaction result data and I'm lost trying to fix my problem : when I enter a channel that is already saved in my DB my code won't execute the right part
My code : https://pastebin.com/yQQtGFFi
7 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!Bump ? ;-;
I compare what's inside the DB and if the server id already exist the bot asks to update IF the channel id is different, if not it say "you have already saved this channel"
but this last part never execute
I don't know how to compare what's inside DB and inside slash command
The code execute normally and i type
/setup_channel
with a channel that already exists the bot think it's another one (and now I've a DB error)
when can i open the DB ?
but when the command is not used for a long time no error will occurred ?
idk if there was an inactivity time that auto close it
iirc,
createConnection
does close the connection after X amount of time of not using it
to resolve this i used createPool
instead of createConnection
and i also used mysql2
, idk if that matters
https://stackoverflow.com/questions/61945682/is-there-a-way-to-fix-the-mysql-reconnection-issue-in-node-js
this explains it betterthx Qjuh and Yorick ^^ (I'll come back if i have any problem again)
:thumbsup: