Androz2091 / discord-giveaways

🎉 Complete framework to facilitate the creation of giveaways using discord.js
https://discord-giveaways.js.org
MIT License
335 stars 127 forks source link

embeColor option not working in GiveawayManager#start method #378

Closed Shashank3736 closed 2 years ago

Shashank3736 commented 3 years ago

Describe the bug

options.embedColor is not working in GiveawayStartOption.

To Reproduce

Start a giveaway and in options.embedColor put "GREEN"

Expected behavior

A green color in embed for giveaway but receive default one.

Additional context

Add any other context about the problem here. The problem is there because of validateEmbedColor method. As this method do not allow string embedColor option.

Shashank3736 commented 3 years ago

Is there any eta when the new discord-giveaways going to be released with the solution? Currently, we can use the develop branch or send numbers instead of strings, but still having it released on npm will be gr8.

Tomato6966 commented 3 years ago

Same thing

I think it's because of Discord.Util.resolveColor returning Something, not changing the value you pass in so it should be something like this:

const validateEmbedColor = (embedColor) => {
    try {
        var embedColorNum = Discord.Util.resolveColor(embedColor);
        if (!isNaN(embedColorNum) && typeof embedColorNum === 'number') return true;
        else return false;
    } catch {
        return false;
    }
};

Proof: image

Nico105 commented 3 years ago

the fix pr is alread merged in dev

Nico105 commented 2 years ago

v5.1.0 has been released