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

code refactored #405

Closed imranbarbhuiya closed 2 years ago

imranbarbhuiya commented 2 years ago

Changes

And sorry, that my prettier changed the code style.

Status

Dragonizedpizza commented 2 years ago

Number.isNaN returns true incase the input is NaN.

imranbarbhuiya commented 2 years ago

Number.isNaN returns true incase the input is NaN.

Yeah that's why used !.

You r saying that if we give a input which isn't a Number then it returns true or you means anything else?

Nico105 commented 2 years ago

Number.isNaN returns true incase the input is NaN.

Yeah that's why used !.

You r saying that if we give a input which isn't a Number then it returns true or you means anything else?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#using_isnan You see the problem... It would still not reject everything which is not a number.

Nico105 commented 2 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite I stumbled across this. I think it would be most suitable, no?

imranbarbhuiya commented 2 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite I stumbled across this. I think it would be most suitable, no?

I was unaware of this xD but I think this is perfect for this purpose. Lmk should I change it to isFinite? As I think using a Number method instead of checking isNan as well as checking number type will be better.

Also I changed code from main branch am I supposed to change do it from dev branch? If so I need to recreate the pr

Nico105 commented 2 years ago

yeah change it to Number.isFinite for now, unless we find a exeption. and for the branching, it should be fine if you edited the main branch since there are not to many differences. But since you're prettier changed the whole file, it would be nice if you recreate/undo the prettier changes and just commit the real changes again. And then you could also start from the develop branch if you're already at it.

imranbarbhuiya commented 2 years ago

Ok sure I'm closing this for now and will be recreating from dev branch to get rid of the conflict.