cqhttp_positive_ws_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: 10 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 {
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

func (*Bot) CallApi

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

func (*Bot) Do

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

Do *

  • @Description: 执行一个api的调用
  • @receiver b
  • @param i
  • example

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: 获取bot的账号
  • @receiver b
  • @return int64
  • example

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
}

func NewDriver

func NewDriver(address string, token string) *Driver

NewDriver *

  • @Description:
  • @return *Driver

func (*Driver) GetBot

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

func (*Driver) GetBots

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

GetBots *

  • @Description:
  • @receiver d
  • @return map[int64]interface{}
  • example

func (*Driver) GetEvent

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

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:
  • @receiver d
  • @param f
  • example

func (*Driver) Run

func (d *Driver) Run(qq, verifyKey string) (b *Bot, err error)

Run *

  • @Description:
  • @receiver d

Jump to

Keyboard shortcuts

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