andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
496 stars 70 forks source link

Enforce minimum permission in the rest methods #355

Open andersfylling opened 3 years ago

andersfylling commented 3 years ago

There is no permission check locally before the request is sent, and this is both a waste of time and rate limits.

Add minimum permissions required to sent a given request in the method itself. Params should be added ontop as needed, as these can be dynamic.

Suggestions:

  1. ~An exported function that links the function pointer to a set of permissions. This way disgord users can also check what base permissions a REST method requires.~
  2. Specify the permissions directly in the method itself. Giving outsiders no information unless the method is called.