bot

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommandNotExist = errors.New("bot: command does not exist")
	ErrUsage           = errors.New("bot: client send usage")
	ErrPermission      = errors.New("bot: insufficient permission")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	SendMessage(context.Context, string, string) error
	CheckPermission(context.Context, Session) (int, error)
}

type Command

type Command interface {
	Execute(context.Context, Session) error
	Usage(context.Context, Session) error
}

type CommandMap

type CommandMap interface {
	ExecuteCommand(context.Context, Session) error
}

type Session

type Session interface {
	Client() Client
	Reply(context.Context, string) error
	Replyf(context.Context, string, ...interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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