Skip to content

Commit

Permalink
feat(message): fully drop v1/update_multi
Browse files Browse the repository at this point in the history
  • Loading branch information
crispgm committed Dec 12, 2023
1 parent 5284ffe commit 26ed303
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
2 changes: 0 additions & 2 deletions message.go
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions message_v1.go
Expand Up @@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions msg_buf.go
Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions msg_buf_test.go
Expand Up @@ -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)
Expand Down

0 comments on commit 26ed303

Please sign in to comment.