parser

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Command string
	Args    []string
	// AtTarget 记录消息开头的@
	AtTarget int64
	// AtArgs 记录命令后的@
	AtArgs []int64
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) AtCheck

func (p *Parser) AtCheck() bool

func (*Parser) CommandName added in v1.0.5

func (p *Parser) CommandName() string

CommandName 返回command本身的名字,不包括command prefix

func (*Parser) CommandPrefix added in v1.0.7

func (p *Parser) CommandPrefix() string

func (*Parser) GetArgs

func (p *Parser) GetArgs() []string

func (*Parser) GetAtArgs added in v1.0.8

func (p *Parser) GetAtArgs() []int64

func (*Parser) GetCmd

func (p *Parser) GetCmd() string

GetCmd 返回包括commandPrefix在内的command字符串

func (*Parser) GetCmdArgs

func (p *Parser) GetCmdArgs() []string

func (*Parser) Parse

func (p *Parser) Parse(elems []message.IMessageElement)

Jump to

Keyboard shortcuts

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