We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b16647e commit d4472f8Copy full SHA for d4472f8
packages/discord.js/src/util/Util.js
@@ -289,12 +289,12 @@ function resolveColor(color) {
289
resolvedColor = (color[0] << 16) + (color[1] << 8) + color[2];
290
}
291
292
- if (resolvedColor < 0 || resolvedColor > 0xffffff) {
293
- throw new DiscordjsRangeError(ErrorCodes.ColorRange);
+ if (!Number.isInteger(resolvedColor)) {
+ throw new DiscordjsTypeError(ErrorCodes.ColorConvert, color);
294
295
296
- if (typeof resolvedColor !== 'number' || Number.isNaN(resolvedColor)) {
297
- throw new DiscordjsTypeError(ErrorCodes.ColorConvert, color);
+ if (resolvedColor < 0 || resolvedColor > 0xffffff) {
+ throw new DiscordjsRangeError(ErrorCodes.ColorRange);
298
299
300
return resolvedColor;
0 commit comments