driver

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package driver provides the default driver of zerobot

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncallClient

type FuncallClient struct {
	// contains filtered or unexported fields
}

FuncallClient ...

func NewFuncallClient

func NewFuncallClient() *FuncallClient

NewFuncallClient 使用函数调用通信

func (*FuncallClient) CallApi

func (f *FuncallClient) CallApi(req zero.APIRequest) (zero.APIResponse, error)

CallApi 发送请求

func (*FuncallClient) Connect

func (f *FuncallClient) Connect()

Connect 连接服务端

func (*FuncallClient) GetResp

func (f *FuncallClient) GetResp() func([]byte)

GetResp ...

func (*FuncallClient) Listen

func (f *FuncallClient) Listen(handler func([]byte, zero.APICaller))

Listen 开始监听事件

func (*FuncallClient) SelfID

func (f *FuncallClient) SelfID() int64

SelfID 获得 bot qq 号

func (*FuncallClient) SetReq

func (f *FuncallClient) SetReq(req func([]byte))

SetReq ...

type WSClient

type WSClient struct {
	Url         string // ws连接地址
	AccessToken string
	// contains filtered or unexported fields
}

WSClient ...

func NewWebSocketClient

func NewWebSocketClient(url, accessToken string) *WSClient

NewWebSocketClient 默认Driver,使用正向WS通信

func (*WSClient) CallApi

func (ws *WSClient) CallApi(req zero.APIRequest) (zero.APIResponse, error)

CallApi 发送ws请求

func (*WSClient) Connect

func (ws *WSClient) Connect()

Connect 连接ws服务端

func (*WSClient) Listen

func (ws *WSClient) Listen(handler func([]byte, zero.APICaller))

Listen 开始监听事件

func (*WSClient) SelfID

func (ws *WSClient) SelfID() int64

SelfID 获得 bot qq 号

Jump to

Keyboard shortcuts

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