逻辑错误发送到飞书

This commit is contained in:
hahwu 2025-02-12 12:21:54 +08:00
parent a1056a5556
commit 862d885d21

View File

@ -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)