commands

package
v0.0.0-...-6d0e092 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotACommand = errors.New("failed to parse first parameter as a command")
)

Functions

This section is empty.

Types

type Command

type Command int64
const (
	Unknown Command = iota
	Help
	//Admin
	BulkRegister
	Register
	Check
	Give
	Take
	// Games
	Dice
	DiceChallenge
	Lottery
)

func (*Command) String

func (c *Command) String() string

type Parameter

type Parameter struct {
	Raw string
	// contains filtered or unexported fields
}

func ParseParameter

func ParseParameter(raw string) *Parameter

func (*Parameter) Float

func (p *Parameter) Float() float32

func (*Parameter) Integer

func (p *Parameter) Integer() int

func (*Parameter) String

func (p *Parameter) String() string

func (*Parameter) Type

func (p *Parameter) Type() ParameterType

func (*Parameter) UserID

func (p *Parameter) UserID() userid.UserID

type ParameterType

type ParameterType int64
const (
	ParamTypeUnknown ParameterType = iota
	ParamTypeString
	ParamTypeInteger
	ParamTypeFloat
	ParamTypeUserID
)

type ParsedCommand

type ParsedCommand struct {
	Command Command
	Params  []Parameter
}

func ParseCommand

func ParseCommand(raw string) (*ParsedCommand, error)

Jump to

Keyboard shortcuts

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