Documentation ¶
Index ¶
- func ChannelRestrictionString(c ChannelRestriction) string
- func RestrictionString(c ChannelRestriction, r RoleRestriction) string
- func RoleRestrictionString(r RoleRestriction) string
- type ACL
- func (a ACL) Check(s *discordgo.Session, m *discordgo.Message, r RoleRestriction, ...) (bool, error)
- func (a ACL) HasRole(u *discordgo.Member, r string) bool
- func (a ACL) IsAdmin(s *discordgo.Session, m *discordgo.Message) (bool, error)
- func (a ACL) IsMusic(m *discordgo.Message, gc *models.Conf) bool
- func (a ACL) IsPrivileged(s *discordgo.Session, m *discordgo.Message, gc *models.Conf) (bool, error)
- type ChannelRestriction
- type RoleRestriction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelRestrictionString ¶
func ChannelRestrictionString(c ChannelRestriction) string
ChannelRestrictionString returns a user-friendly representation of the channel restriction
func RestrictionString ¶
func RestrictionString(c ChannelRestriction, r RoleRestriction) string
RestrictionString returns a user-friendly representation of an restriction pair
func RoleRestrictionString ¶
func RoleRestrictionString(r RoleRestriction) string
RoleRestrictionString returns a user-friendly representation of the role restriction
Types ¶
type ACL ¶
type ACL struct {
// contains filtered or unexported fields
}
func (ACL) Check ¶
func (a ACL) Check(s *discordgo.Session, m *discordgo.Message, r RoleRestriction, c ChannelRestriction) (bool, error)
Check will perform checks for the given RoleRestriction and ChannelRestriction.
type ChannelRestriction ¶
type ChannelRestriction int
const ( Music ChannelRestriction = iota Anywhere )
type RoleRestriction ¶
type RoleRestriction int
const ( Admin RoleRestriction = iota Privileged Anyone )
Click to show internal directories.
Click to hide internal directories.