feat(通知): SafeW 只发正文并注入推送时间

去掉渠道标题前缀,模板可用 pushedAt 显示本地推送时间。
This commit is contained in:
2026-08-16 01:18:27 +08:00
parent a9b6234208
commit 14504af950
5 changed files with 42 additions and 6 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ func (s *SafeWSender) Send(title, content string, config json.RawMessage) error
payload := safewMessage{
ChatID: chatID,
Text: title + "\n" + content,
Text: content,
}
body, err := json.Marshal(payload)
if err != nil {
+1 -1
View File
@@ -49,7 +49,7 @@ func TestSafeWSenderSendSuccess(t *testing.T) {
if gotBody["parse_mode"] != nil && gotBody["parse_mode"] != "" {
t.Fatalf("parse_mode = %#v, want omitted/plain", gotBody["parse_mode"])
}
wantText := "hello_world.\nprice=1.5"
wantText := "price=1.5"
if gotBody["text"] != wantText {
t.Fatalf("text = %#v, want %#v", gotBody["text"], wantText)
}