Documentation ¶
Overview ¶
Package roleutil provides general purpose utilities for discordgo.Role objects and arrays.
Index ¶
- func GetSortedGuildRoles(s discordutil.ISession, guildID string, reversed bool) ([]*discordgo.Role, error)
- func GetSortedMemberRoles(s discordutil.ISession, guildID, memberID string, reversed bool, ...) ([]*discordgo.Role, error)
- func PositionDiff(m1 *discordgo.Member, m2 *discordgo.Member, g *discordgo.Guild) int
- func SortRoles(r []*discordgo.Role, reversed bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSortedGuildRoles ¶
func GetSortedGuildRoles(s discordutil.ISession, guildID string, reversed bool) ([]*discordgo.Role, error)
GetSortedGuildRoles tries to fetch the roles of a given guild and returns the role array in sorted ascending order by position. If any error occurs, the error is returned as well. If reversed, the order is descending.
func GetSortedMemberRoles ¶
func GetSortedMemberRoles(s discordutil.ISession, guildID, memberID string, reversed bool, includeEveryone bool) ([]*discordgo.Role, error)
GetSortedMemberRoles tries to fetch the roles of a given member on a given guild and returns the role array in sorted ascending order by position. If any error occurs, the error is returned as well. If reversed, the order is descending.
func PositionDiff ¶
PositionDiff : m1 position - m2 position PositionDiff returns the difference number between the top most role of member m1 and member m2 on the specified guild g by subtracting m1MaxPos - m2MaxPos.
Types ¶
This section is empty.