diff --git a/src/server/GoUtil/feishu.go b/src/server/GoUtil/feishu.go index 36d6416b..c3b8aec4 100644 --- a/src/server/GoUtil/feishu.go +++ b/src/server/GoUtil/feishu.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "net/http" + "server/conf" ) const ( @@ -14,9 +15,35 @@ const ( func SendFeishuMsg(msg string) error { // 创建请求体 payload := map[string]interface{}{ - "msg_type": "text", - "content": map[string]string{ - "text": msg, + "msg_type": "post", + "content": map[string]interface{}{ + "post": map[string]interface{}{ + "zh_cn": map[string]interface{}{ + "title": "服务器报错提醒", + "content": [][]map[string]interface{}{ + { + { + "tag": "text", + "text": fmt.Sprintf("AppName:%s", conf.Server.GameName), + // "style": []string{"bold", "lineThrough"}, + }, + }, + { + { + "tag": "text", + "text": fmt.Sprintf("ServerName:%s", conf.Server.ServerName), + // "style": []string{"bold", "lineThrough"}, + }, + }, + { + { + "tag": "text", + "text": msg, + }, + }, + }, + }, + }, }, } payloadBytes, err := json.Marshal(payload)