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!
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')
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')