18 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!Using data.
Saving data.
If anyone could help that would be great I am new to JS.
what is your strikeSchema
Using mongodb
tag suggestion for @GhostBear9:
- Discord ids follow the snowflake format: learn more
- Discord ids must be represented as strings as they are larger than
Number.MAX_SAFE_INTEGER, the largest integer that can be represented in JavaScript
you cannot save it and then retrieve it as a number
it'll be a different one
truncated to be less than the max safe integer
So should I save it as a string?
Then convert it as needed?
you don't need it to convert it anywhere though
unless you're doing math with it?
No not really I guess.
if you are then you'd need a bigint
then yeah you don't need to convert
Okay I'll try storing it as a string then, I bet it will work. Thank you so much!
it may seem a database issue tho, the code itself seems fine, have you debugged it?
or use .toString() when grabbing
Yea
im sure it should have that option
I've tried a lot but it works now.
perfect
Also looked back at my other code and previously I have stored user ids as strings.
oh yea, you wont use numbers at all in discord.js