TypeError [ColorConvert]: Unable to convert "16705372" to a number
Hey, I am using [email protected], and when importing Colors from discord.js and using .setColor(Colors.Red), it gives me the error:
TypeError [ColorConvert]: Unable to convert "16705372" to a number
Any ideas on how to fix it?8 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 OPExample function that produces this error:
from where did you import embedbuilder
const { EmbedBuilder, Colors, resolveColor } = require('discord.js');
looks like an issue for #djs-in-dev-version then
I added the dev release tag
The errors indicate that the line where it happens use .setColor(Colors.Red)
It errors for .setColor(Colors.Yellow) too
I tried hardcoding the values like this:
but it prints the same error for some reason
.setColor(Colors.Yellow)
In this context:
Trying this change right now to see if it works: https://github.com/discordjs/discord.js/commit/3755e66d411efd6ed210d5070a0257c742c336d6
GitHub
fix(resolveColor): Address case for numbers (#10115) · discordjs/di...
fix(resolveColor): address case for numbers
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This fixed the issue, I didn't even know I was using such an old version of d.js@dev
Thanks for the dedicated time tho