Currently on dsp, if a bot attempts to add a role which is higher on the higherarchy then itself an UnauthorizedException will be thrown.
There exists an int | DiscordMember#Hierarchy property which gives the position of the member on the role hierarchy, but thats hidden and its more common to see a try-catch then that property being used.
Proposal
The creation of an HierarchyUtils that adds the following functions
Problem
Currently on dsp, if a bot attempts to add a role which is higher on the higherarchy then itself an
UnauthorizedException
will be thrown. There exists anint | DiscordMember#Hierarchy
property which gives the position of the member on the role hierarchy, but thats hidden and its more common to see atry-catch
then that property being used.Proposal
The creation of an
HierarchyUtils
that adds the following functionswith more being added in the future.
That would allow for the following code
to be simplified to: