handlers

package
v0.0.0-...-1d2b739 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppID string
View Source
var BotID string

Functions

func ConvertMapToJSONString

func ConvertMapToJSONString(m map[string]interface{}) (string, error)

将map转化为json string

func ConvertToInt64

func ConvertToInt64(value interface{}) (int64, error)

ConvertToInt64 尝试将 interface{} 类型的值转换为 int64 类型

func ConvertToSegmentedMessage

func ConvertToSegmentedMessage(data string) []map[string]interface{}

将收到的data.content转换为message segment todo,群场景不支持受图片,频道场景的图片可以拼一下

func ParseMessageContent

func ParseMessageContent(message interface{}) string

func SendResponse

func SendResponse(Wsclient []*wsclient.WebSocketClient, err error, message *callapi.ActionMessage) (string, error)

SendResponse 向所有连接的WebSocket客户端广播回执信息

Types

type ServerResponse

type ServerResponse struct {
	Data struct {
		MessageID int `json:"message_id"`
	} `json:"data"`
	Message string      `json:"message"`
	RetCode int         `json:"retcode"`
	Status  string      `json:"status"`
	Echo    interface{} `json:"echo"`
}

定义响应结构体

Jump to

Keyboard shortcuts

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