feat(sender/onebot): 新增onebot协议支持

This commit is contained in:
mei
2026-03-01 15:27:45 +08:00
parent e68d48e816
commit 4f305cfeda
19 changed files with 214 additions and 245 deletions
+16
View File
@@ -0,0 +1,16 @@
package sender
import (
"log"
"github.com/CatchZeng/dingtalk/pkg/dingtalk"
)
func SendDingTalkMsg(title string, msg string, accessToken string, secret string) {
client := dingtalk.NewClient(accessToken, secret)
sendMsg := dingtalk.NewMarkdownMessage().SetMarkdown(title, msg)
_, _, err := client.Send(sendMsg)
if err != nil {
log.Printf("发送钉钉消息失败: %v", err)
}
}