Documentation
¶
Index ¶
- Variables
- type ActionMux
- func (a *ActionMux) AddRegexRequestInterface(actionRegex string, f protocol.RequestInterface) error
- func (a *ActionMux) AddRequestInterface(f protocol.RequestInterface) error
- func (a *ActionMux) DeleteRegexRequestInterface(actionRegex string)
- func (a *ActionMux) DeleteRequestInterface(action string)
- func (a *ActionMux) GetRequestInterface(action string) (f protocol.RequestInterface)
- type Bot
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorActionExist action已存在 ErrorActionExist = errors.New("action already exist") // ErrorActionEmpty action为空 ErrorActionEmpty = errors.New("action is empty") )
View Source
var ( // ErrorConnectionUUIDNotFound 连接UUID未找到 ErrorConnectionUUIDNotFound = errors.New("connection uuid not found") )
Functions ¶
This section is empty.
Types ¶
type ActionMux ¶
type ActionMux struct {
// contains filtered or unexported fields
}
ActionMux 请求处理接口
func (*ActionMux) AddRegexRequestInterface ¶
func (a *ActionMux) AddRegexRequestInterface(actionRegex string, f protocol.RequestInterface) error
AddRegexRequestInterface 添加一个正则匹配动作请求接口
func (*ActionMux) AddRequestInterface ¶
func (a *ActionMux) AddRequestInterface(f protocol.RequestInterface) error
AddRequestInterface 添加一个请求处理接口
action: 请求的action名称
f: 请求处理接口 protocol.RequestInterface 的实现
func (*ActionMux) DeleteRegexRequestInterface ¶
func (*ActionMux) DeleteRequestInterface ¶
DeleteRequestInterface 删除一个请求处理接口
func (*ActionMux) GetRequestInterface ¶
func (a *ActionMux) GetRequestInterface(action string) (f protocol.RequestInterface)
GetRequestInterface 获取一个请求处理接口
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot 一个oneBot实例
func NewOneBot ¶
func NewOneBot(config protocol.OneBotConfig, userId string) (b *Bot)
NewOneBot 获取一个OneBot实例
需要传入config配置和userId
func (*Bot) AddConnection ¶
func (b *Bot) AddConnection(c connect.Connection) error
AddConnection 添加一个连接
Click to show internal directories.
Click to hide internal directories.