feat(通知): SafeW 只发正文并注入推送时间
去掉渠道标题前缀,模板可用 pushedAt 显示本地推送时间。
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user