roles

package
v0.0.0-...-ca060dc Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegionsContain

func RegionsContain(regions []RoleRegion, role discord.RoleID) bool

Types

type RoleRegion

type RoleRegion struct {
	RoleHeader discord.RoleID
	RoleName   string
	RegionName string
	Position   int32

	AllowGive bool

	ChildrenIDs []discord.RoleID
}

RoleRegion is the struct for a role region.

type Roles

type Roles struct {
	Ctx *bot.Context
	// contains filtered or unexported fields
}

func New

func New(node db.Node) *Roles

func (*Roles) CanGive

func (r *Roles) CanGive(
	m *gateway.MessageCreateEvent,
	header string, allow bool) (string, error)

func (*Roles) List

func (r *Roles) List(m *gateway.MessageCreateEvent) error

func (*Roles) Name

func (r *Roles) Name(m *gateway.MessageCreateEvent, h, n string) (string, error)

func (*Roles) Reset

func (r *Roles) Reset(m *gateway.MessageCreateEvent) error

func (*Roles) Setup

func (r *Roles) Setup(sub *bot.Subcommand)

func (*Roles) Split

func (r *Roles) Split(m *gateway.MessageCreateEvent, header string) error

func (*Roles) Toggle

func (*Roles) Update

func (r *Roles) Update(m *gateway.MessageCreateEvent) error

Update cycles through all regions and update their children IDs. Run this after you've made changes to the roles.

Jump to

Keyboard shortcuts

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