Issues with channel ID fetched from MySQL database.
I have been wracking my brain on this one. I'm trying to create a very command that shows me what channel it is assigned to. I have it connected to a MySQL database and the command to set the channel works perfectly. It inserts the correct ID into the same table as the server ID, but when I try to use the command to verify the channel, I keep getting errors.
For example: in my database, it's showing me "1209590565503635470" for the channel ID. This is the correct one and matches when I right click and copy ID. However, I get this error in my console from node when I use the command:
For some reason, it's showing the wrong channel ID. I originally suspected a caching issue, but after going off to do another part of the same app, it still shows that.
Bear with me, I've rewritten this a few million times now, so it may look a little funky now, but this is these are the commands to set the channel and showing the channel that was set:
Anybody have any insight to this? It's driving me crazy. 😵💫
6 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!
- ✅
Marked as resolved by OPdiscord.js version - 14.14.1
node version 21.7.1
make sure your model isn't saving ids as numbers just in case
I had switched them to strings, but I was still getting it
They can be integers, save the channel I'd as BigInt. Ensure supportBigNumbers=true
Console out the returned details from the DB ensure your calling it correctly.
Thank you. This actually helped and fixed my issue!