Androz2091 / discord-giveaways

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

Bug in exemptMembers #501

Closed Faironic closed 1 year ago

Faironic commented 1 year ago

It looks like the function is being stored as a string in the database instead of being evaluated as a JavaScript function. When I use the following code it stores exemptMembers as it is in the database instead of keeping it as a function!

exemptMembers: (member, giveaway) => !member.roles.cache.has(role.id),

The role variable is input by the user as a required role for the giveaway. Instead of replacing role.id with the actual role id, it keeps it as it is. Later when the giveaway ends I get an error:

TypeError: Cannot read properties of undefined (reading 'role')