eritbh / yuuko

🔰 No-frills Discord command framework for Eris
http://eritbh.me/yuuko
MIT License
17 stars 2 forks source link

Feature Request: globalCommandRequirements as client option instead of assigning it after #69

Closed NotReallyEight closed 3 years ago

NotReallyEight commented 3 years ago

A cool thing could actually be to make

globalCommandRequirements

a client option instead of a property to assign later as the code will look a little bit cleaner Making it look like something like:

const client = new Client({
  otheroptions: 'bla',
  globalCommandRequirements: {
    dmOnly: false,
    guildOnly: true
  }
})
eritbh commented 3 years ago

This seems like a logical request, I'm not entirely sure why global command requirements are set by a method call rather than in the constructor. Maybe when I go to implement it I'll find a reason it is the way it is, but hopefully not...

NotReallyEight commented 3 years ago

Oki 👍

eritbh commented 3 years ago

Currently we do have a client option ignoreGlobalRequirements which is probably not necessary anymore if we're setting the requirements from the constructor - you should be able to just do globalCommandRequirements: someCondition ? {} : {...yourCustomRequirements} instead. To avoid a breaking change, that option will still exist for now, but I'll deprecate it and make an issue to remove that for the next major version.