wsclient

package
v0.0.0-...-e4931e2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateMessage

func TruncateMessage(message callapi.ActionMessage, maxLength int) string

截断信息

Types

type WebSocketClient

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

func NewWebSocketClient

func NewWebSocketClient(urlStr string, botID uint64, dg *discordgo.Session, maxRetryAttempts int) (*WebSocketClient, error)

NewWebSocketClient 创建 WebSocketClient 实例,接受 WebSocket URL、botID 和 openapi.OpenAPI 实例

func (*WebSocketClient) Close

func (ws *WebSocketClient) Close() error

func (*WebSocketClient) Reconnect

func (client *WebSocketClient) Reconnect()

断线重连

func (*WebSocketClient) SendMessage

func (c *WebSocketClient) SendMessage(message map[string]interface{}) error

发送json信息给onebot应用端

Jump to

Keyboard shortcuts

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