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) SendMessage ¶
func (c *WebSocketClient) SendMessage(message map[string]interface{}) error
发送json信息给onebot应用端
Click to show internal directories.
Click to hide internal directories.