Documentation ¶
Index ¶
- func MergeRolePermissions(member *disgord.Member, roles []*disgord.Role) (perms models.DiscordPermissions)
- type BotPermissions
- type Cache
- func (pc *Cache) Get(guildID disgord.Snowflake) models.DiscordPermissions
- func (pc *Cache) GuildCreate(sess disgord.Session, event *disgord.GuildCreate) (models.DiscordPermissions, error)
- func (pc *Cache) GuildMemberUpdate(sess disgord.Session, event *disgord.GuildMemberUpdate)
- func (pc *Cache) GuildRoleChange(sess disgord.Session, guildID disgord.Snowflake)
- func (pc *Cache) GuildUpdate(sess disgord.Session, event *disgord.GuildUpdate) (models.DiscordPermissions, error)
- func (pc *Cache) RemoveGuild(guildID disgord.Snowflake)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeRolePermissions ¶
func MergeRolePermissions(member *disgord.Member, roles []*disgord.Role) (perms models.DiscordPermissions)
MergeRolePermissions converts the role id's that it has permission for, and generates a permission bit based of all access.
Types ¶
type BotPermissions ¶
type BotPermissions struct {
// contains filtered or unexported fields
}
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(ctx context.Context, es *guildlogger.EventStream) *Cache
NewPermissionsCache returns a new permissions cache.
func (*Cache) GuildCreate ¶
func (pc *Cache) GuildCreate(sess disgord.Session, event *disgord.GuildCreate) (models.DiscordPermissions, error)
func (*Cache) GuildMemberUpdate ¶
func (pc *Cache) GuildMemberUpdate(sess disgord.Session, event *disgord.GuildMemberUpdate)
TODO: this doesn't seem to trigger when we add or remove roles from ourselves.
func (*Cache) GuildRoleChange ¶
func (*Cache) GuildUpdate ¶
func (pc *Cache) GuildUpdate(sess disgord.Session, event *disgord.GuildUpdate) (models.DiscordPermissions, error)
func (*Cache) RemoveGuild ¶
Click to show internal directories.
Click to hide internal directories.