snowflake and string comparison
Hi everybody,
I need to compare channel.id which is a snowflake type with a string id that is saved in my database. The operator"===" returns false for channel.id===id even though they have the same value. How to compare them?
5 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!if === returns false, they are either not the same id, or you didn't save it as string, but as a number
In the logs I can see that they are the same id and in my database it is saved as a string
log it
show it
Maybe you parsed it to JSON or something?