role

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

func (*Entity) CreateRole

func (e *Entity) CreateRole(ctx context.Context, id, guildId int64, name string, color int, permissions int64, hoist bool) error

func (*Entity) GetGuildRoles

func (e *Entity) GetGuildRoles(ctx context.Context, guildId int64) ([]model.Role, error)

func (*Entity) GetRoleByID

func (e *Entity) GetRoleByID(ctx context.Context, id int64) (model.Role, error)

func (*Entity) GetRolesBulk

func (e *Entity) GetRolesBulk(ctx context.Context, guildID int64, ids []int64) ([]model.Role, error)

func (*Entity) RemoveRole

func (e *Entity) RemoveRole(ctx context.Context, id int64) error

func (*Entity) SetRoleColor

func (e *Entity) SetRoleColor(ctx context.Context, id int64, color int) error

func (*Entity) SetRoleHoist added in v1.14.0

func (e *Entity) SetRoleHoist(ctx context.Context, id int64, hoist bool) error

func (*Entity) SetRoleName

func (e *Entity) SetRoleName(ctx context.Context, id int64, name string) error

func (*Entity) SetRolePermissions

func (e *Entity) SetRolePermissions(ctx context.Context, id int64, permissions int64) error

func (*Entity) SetRolePosition added in v1.7.0

func (e *Entity) SetRolePosition(ctx context.Context, updates []model.RoleUpdatePosition) (err error)

type Role

type Role interface {
	GetRoleByID(ctx context.Context, id int64) (model.Role, error)
	GetGuildRoles(ctx context.Context, guildId int64) ([]model.Role, error)
	GetRolesBulk(ctx context.Context, guildID int64, ids []int64) ([]model.Role, error)
	CreateRole(ctx context.Context, id, guildId int64, name string, color int, permissions int64, hoist bool) error
	RemoveRole(ctx context.Context, id int64) error
	SetRoleColor(ctx context.Context, id int64, color int) error
	SetRoleName(ctx context.Context, id int64, name string) error
	SetRolePermissions(ctx context.Context, id int64, permissions int64) error
	SetRoleHoist(ctx context.Context, id int64, hoist bool) error
	SetRolePosition(ctx context.Context, updates []model.RoleUpdatePosition) error
}

func New

func New(c *sqlx.DB) Role

Jump to

Keyboard shortcuts

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