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

feat: add `MessageActionRow` components in MessageObject #422

Closed imranbarbhuiya closed 2 years ago

imranbarbhuiya commented 2 years ago

Changes

This pr adds a new option for components in MessageObject

Status

Nico105 commented 2 years ago

Combining the embed readme part with this one would maybe be better and then naming it smth like "More message options" or "Message customizations".

Also maybe filling in linkURL or what its name is* would be good if someone wants to link to the gaw without editing the message after start()

Nico105 commented 2 years ago

finger slipped

imranbarbhuiya commented 2 years ago

Also maybe filling in linkURL or what its name is* would be good if someone wants to link to the gaw without editing the message after start()

I've changed the code to allow linkbutton and selectmenu.

I've tested both type of buttons and they are working fine. I didn't tested selectmenu I'll test when i'll get time or u can test it.

imranbarbhuiya commented 2 years ago

I'm not that good at wording. Please change it to whatever will suit.

Nico105 commented 2 years ago

both blocks are referring to winMessage... But anyway, we would need such a block for noWinnerMessage and error of rerroll too. So lets just make it a fillInComponents function, no?

imranbarbhuiya commented 2 years ago

both blocks are referring to winMessage... But anyway, we would need such a block for noWinnerMessage and error of rerroll too. So lets just make it a fillInComponents function, no?

I've updated the code to allow no winner messages also.

Nico105 commented 2 years ago

we would have to add | MessageActionRowOptions too right? Cause it's at least guaranteed through serialization in case of winMessage. (function behaviour doesn't change)

imranbarbhuiya commented 2 years ago

we would have to add | MessageActionRowOptions too right? Cause it's at least guaranteed through serialization in case of winMessage. (function behaviour doesn't change)

added

imranbarbhuiya commented 2 years ago

I just realized I need to create a new instance for action row or it'll change all the {} to a value and it won't get changed in the next fillInComponent. I'll fix it later.

imranbarbhuiya commented 2 years ago

should be fine right?

Yeah.

Nico105 commented 2 years ago

👍