From b8a54019de6625e1624c20927867dc681bd5eaa7 Mon Sep 17 00:00:00 2001 From: David Zhang Date: Tue, 12 Dec 2023 19:27:50 +0800 Subject: [PATCH] feat(message): fully drop v1/update_multi --- message.go | 2 -- message_v1.go | 5 ++--- msg_buf.go | 7 ------- msg_buf_test.go | 7 ------- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/message.go b/message.go index 47bc2e0..2efe9af 100644 --- a/message.go +++ b/message.go @@ -28,8 +28,6 @@ type OutcomingMessage struct { UnionID string `json:"-"` // For reply RootID string `json:"root_id,omitempty"` - // UpdateMulti card - UpdateMulti bool `json:"update_multi"` // Sign for notification bot Sign string `json:"sign"` // Timestamp for sign diff --git a/message_v1.go b/message_v1.go index 33beabb..75b61ab 100644 --- a/message_v1.go +++ b/message_v1.go @@ -5,9 +5,8 @@ import "strconv" // BuildOutcomingMessageReq for msg builder func BuildOutcomingMessageReq(om OutcomingMessage) map[string]interface{} { params := map[string]interface{}{ - "msg_type": om.MsgType, - "update_multi": om.UpdateMulti, - "chat_id": om.ChatID, // request must contain chat_id, even if it is empty + "msg_type": om.MsgType, + "chat_id": om.ChatID, // request must contain chat_id, even if it is empty } params[om.UIDType] = buildReceiveID(om) if len(om.RootID) > 0 { diff --git a/msg_buf.go b/msg_buf.go index a45eb20..a0b1cfd 100644 --- a/msg_buf.go +++ b/msg_buf.go @@ -76,13 +76,6 @@ func (m *MsgBuffer) BindReply(rootID string) *MsgBuffer { return m } -// UpdateMulti deprecated in the latest version, please use card.UpdateMulti instead -// set multi for shared card. Default false, not share -func (m *MsgBuffer) UpdateMulti(flag bool) *MsgBuffer { - m.message.UpdateMulti = flag - return m -} - // WithSign generates sign for notification bot check func (m *MsgBuffer) WithSign(secret string, ts int64) *MsgBuffer { m.message.Sign, _ = GenSign(secret, ts) diff --git a/msg_buf_test.go b/msg_buf_test.go index 9f54e65..07ca30f 100644 --- a/msg_buf_test.go +++ b/msg_buf_test.go @@ -128,13 +128,6 @@ func TestWorkWithTextBuilder(t *testing.T) { assert.Equal(t, "hello, world\n", mb.message.Content.Text.Text) } -func TestMsgUpdateMulti(t *testing.T) { - mb := NewMsgBuffer(MsgInteractive) - msg := mb.BindOpenChatID("6559399282837815565").UpdateMulti(true).Build() - assert.Equal(t, MsgInteractive, msg.MsgType) - assert.True(t, msg.UpdateMulti) -} - func TestWithSign(t *testing.T) { mb := NewMsgBuffer(MsgText) assert.Empty(t, mb.message.Sign)