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

exemptMembers & bonus Functions don't work on Bot Restart #387

Closed Tomato6966 closed 3 years ago

Tomato6966 commented 3 years ago

Latest Version

If i do something like: bonus: (member) => member.roles.cache.some((r) => r.id === ${bonusentriesdata.mentions.roles.first().id}) ? 1 : null

it doesnt work cause bonusentriesdata is undefined.

Ik the problem is that it doesnt remember the variable. so those function data should be stored in some sort of db somehow. Maybe this should be implemented in the package?

Nico105 commented 3 years ago

https://github.com/Androz2091/discord-giveaways#bonus-entries => 2nd code block (you have to use that "format") and read the 2nd note => extraData

Tomato6966 commented 3 years ago

yes but if i stop the bot the variable is not available anymore

Nico105 commented 3 years ago

your example is not in the new Function() format, so yeah that's why it won't work... as said

Tomato6966 commented 3 years ago

uhm let me try

Nico105 commented 3 years ago

Falls es dir leichter damit geht, kann ich auch deutsch btw

Tomato6966 commented 3 years ago

Dankeschön, das hat funktioniert und ist, genau was ich gesucht habe.

Wusste nicht, dass es so etwas gibt!

Hab auch gleich reinstudiert, warum und wie das funktioniert! thx