cqhttp_http_driver

package
v0.0.0-...-dddcec1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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) CallApi

func (b *Bot) CallApi(action string, param interface{}) gjson.Result

func (*Bot) Do

func (b *Bot) Do(i interface{})

Do *

  • @Description:
  • @receiver b
  • @param i

func (*Bot) GetResponse

func (b *Bot) GetResponse(echo string) ([]byte, error)

GetResponse *

  • @Description: 获取一个api调用的响应
  • @receiver b
  • @param echo api调用的唯一标识
  • @return []byte
  • @return error
  • example

func (*Bot) GetSelfId

func (b *Bot) GetSelfId() int64

GetSelfId *

  • @Description:
  • @receiver b
  • @return int64

func (*Bot) SendGroupMsg

func (b *Bot) SendGroupMsg(groupID int64, message interface{}) int32

func (*Bot) SendPrivateMsg

func (b *Bot) SendPrivateMsg(userID int64, message interface{}) int32

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) GetBot

func (d *Driver) GetBot(i int64) interface{}

GetBot *

  • @Description: 获取一个bot对象
  • @receiver d
  • @param i
  • @return interface{}

func (*Driver) GetBots

func (d *Driver) GetBots() map[int64]interface{}

GetBots *

  • @Description: 获取一个bot对象
  • @receiver d
  • @return map[int64]interface{}
  • example

func (*Driver) GetEvent

func (d *Driver) GetEvent() chan []byte

GetEvent *

  • @Description: 获取事件信息通道
  • @receiver d
  • @return chan

func (*Driver) OnConnect

func (d *Driver) OnConnect(f func(selfId int64, host string, clientRole string))

OnConnect *

  • @Description:
  • @receiver d
  • @param f
  • example

func (*Driver) OnDisConnect

func (d *Driver) OnDisConnect(f func(selfId int64))

OnDisConnect *

  • @Description: 注册一个bot断开时的钩子
  • @receiver d
  • @param f
  • example

func (*Driver) Run

func (d *Driver) Run()

Run *

  • @Description:
  • @receiver d

func (*Driver) ServeHTTP

func (d *Driver) ServeHTTP(writer http.ResponseWriter, request *http.Request)

func (*Driver) SetToken

func (d *Driver) SetToken(token string)

SetToken *

  • @Description:
  • @receiver d
  • @param token

Jump to

Keyboard shortcuts

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