rolerules

package
v0.0.0-...-ba096a2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confirmation

type Confirmation struct {
	ComPrefix string
}

func (*Confirmation) Apply

func (r *Confirmation) Apply(session *discordgo.Session, action *RoleAction) (success bool, message string)

func (*Confirmation) Check

func (r *Confirmation) Check(session *discordgo.Session, action *RoleAction) (success bool, message string)

type Exclusive

type Exclusive struct {
	ExclusiveRoles []types.Role
}

func (*Exclusive) Apply

func (r *Exclusive) Apply(session *discordgo.Session, action *RoleAction) (success bool, message string)

func (*Exclusive) Check

func (r *Exclusive) Check(session *discordgo.Session, action *RoleAction) (success bool, message string)

type NoMultiples

type NoMultiples struct {
	ExclusiveRoles []types.Role
}

func (*NoMultiples) Apply

func (r *NoMultiples) Apply(session *discordgo.Session, action *RoleAction) (success bool, message string)

func (*NoMultiples) Check

func (r *NoMultiples) Check(session *discordgo.Session, action *RoleAction) (success bool, message string)

type NoRemove

type NoRemove struct {
	ReferenceGroup types.RoleGroup
}

func (*NoRemove) Apply

func (r *NoRemove) Apply(session *discordgo.Session, action *RoleAction) (success bool, message string)

func (*NoRemove) Check

func (r *NoRemove) Check(session *discordgo.Session, action *RoleAction) (success bool, message string)

type Points

type Points struct {
	PointsTreshold int
}

func (*Points) Apply

func (r *Points) Apply(session *discordgo.Session, action *RoleAction) (success bool, message string)

func (*Points) Check

func (r *Points) Check(session *discordgo.Session, action *RoleAction) (success bool, message string)

type RoleAction

type RoleAction struct {
	Role            *types.Role
	UserRank        *types.UserServerRank
	Member          *discordgo.Member
	Guild           *discordgo.Guild
	Channel         *discordgo.Channel
	OriginalMessage *discordgo.Message
	Action          RoleActionType
}

RoleAction Action being performed on the role

type RoleActionType

type RoleActionType int

RoleActionType Type of action being performed on the role

const (
	//RoleAdd Adding the role
	RoleAdd RoleActionType = 1
	//RoleRemove Removing the role
	RoleRemove RoleActionType = 2
)

type RoleRule

type RoleRule interface {
	Check(session *discordgo.Session, action *RoleAction) (success bool, message string)
	Apply(session *discordgo.Session, action *RoleAction) (success bool, message string)
}

RoleRule Rule defining if and how a role should be applied

func GetRulesForRole

func GetRulesForRole(server *types.Server, role *types.Role, comPrefix string) ([]RoleRule, error)

Jump to

Keyboard shortcuts

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