Documentation ¶
Index ¶
- type Bot
- func (b *Bot) CallApi(action string, param interface{}) gjson.Result
- func (b *Bot) Do(i interface{})
- func (b *Bot) GetResponse(echo string) ([]byte, error)
- func (b *Bot) GetSelfId() int64
- func (b *Bot) SendGroupMsg(groupID int64, message interface{}) int32
- func (b *Bot) SendPrivateMsg(userID int64, message interface{}) int32
- type Driver
- func (d *Driver) GetBot(i int64) interface{}
- func (d *Driver) GetBots() map[int64]interface{}
- func (d *Driver) GetEvent() chan []byte
- func (d *Driver) OnConnect(f func(selfId int64, host string, clientRole string))
- func (d *Driver) OnDisConnect(f func(selfId int64))
- func (d *Driver) Run()
- func (d *Driver) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (d *Driver) SetToken(token string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot @Description:
func (*Bot) GetResponse ¶
GetResponse *
- @Description: 获取一个api调用的响应
- @receiver b
- @param echo api调用的唯一标识
- @return []byte
- @return error
- example
func (*Bot) SendGroupMsg ¶
func (*Bot) SendPrivateMsg ¶
type Driver ¶
type Driver struct { Name string // contains filtered or unexported fields }
Driver @Description:
func NewDriver ¶
func NewDriver(address string, webhooks []struct { postHost string postPort int selfID int64 }) *Driver
NewDriver *
- @Description: 创建一个cqhttp的http通信方式驱动
- @return *Driver
func (*Driver) GetBots ¶
GetBots *
- @Description: 获取一个bot对象
- @receiver d
- @return map[int64]interface{}
- example
func (*Driver) OnDisConnect ¶
OnDisConnect *
- @Description: 注册一个bot断开时的钩子
- @receiver d
- @param f
- example
Click to show internal directories.
Click to hide internal directories.