permissions

package
v0.0.0-...-d1147f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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) Get

func (pc *Cache) Get(guildID disgord.Snowflake) models.DiscordPermissions

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 (pc *Cache) GuildRoleChange(sess disgord.Session, guildID disgord.Snowflake)

func (*Cache) GuildUpdate

func (pc *Cache) GuildUpdate(sess disgord.Session, event *disgord.GuildUpdate) (models.DiscordPermissions, error)

func (*Cache) RemoveGuild

func (pc *Cache) RemoveGuild(guildID disgord.Snowflake)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL