Androz2091 / discord-giveaways-bot

🎁Giveways Bot using the discord-giveaways package
ISC License
203 stars 169 forks source link

[Suggestion] Role Requirement, Guild Requirement #42

Open inxec opened 4 years ago

inxec commented 4 years ago

This feature is really cool, especially cuz a lot of people want to have a bot something like Santa Wumpus, or Prism, which both has these feature and much more. Hope you can make this true, its alright if not, its just a suggestion ❤

DamaraNadhra commented 3 years ago

how do I make this command? I really need it

DamaraNadhra commented 3 years ago

image how do I implement this on my code, I want my giveaways need role requirements

Nico105 commented 3 years ago

You can just copy it in you index/bot.js file after the manager part or you can create an extra file for it

DamaraNadhra commented 3 years ago

image I add that in my index.js, but it says cannot read property 'members' of undefined

DamaraNadhra commented 3 years ago

oh nvm it works now, but any idea how to implement that into roles?

DamaraNadhra commented 3 years ago

image I tried this and works but, I kept getting error, cannot read property "guild" of null but actually the command is works

Nico105 commented 3 years ago

Better use client.guilds.cache.get(giveaway.guildID) instead of giveaway.message.guild because .message can be null as your error confirms

DamaraNadhra commented 3 years ago

cannot read property "roles" of undefined, I use client.guilds.cache.get(giveaway.guildID).roles.cache.get(${roleRequrement}).members.filter(u => !u.bot).has(member.id)

Nico105 commented 3 years ago

We have added an example for role requirement in the discord-giveaways docs in the giveawayReactionAdded event, if you still need this info Maybe it gets added to the bot itself somewhen And btw I do not recommend using guild requirement anymore because Discord changed its mood and says that it is a kind of advertising and should not get used anymore.