Skip to content

Commit

Permalink
fix: payload for sendmessage to prevent upsert user
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnarkhede committed Apr 5, 2024
1 parent 8580735 commit 72ef6ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Message struct {
Silent bool `json:"silent,omitempty"`

User *User `json:"user"`
UserID string `json:"user_id"`
Attachments []*Attachment `json:"attachments"`
LatestReactions []*Reaction `json:"latest_reactions"` // last reactions
OwnReactions []*Reaction `json:"own_reactions"`
Expand Down Expand Up @@ -256,7 +257,8 @@ func (ch *Channel) SendMessage(ctx context.Context, message *Message, userID str
return nil, errors.New("user ID must be not empty")
}

message.User = &User{ID: userID}
message.User = nil
message.UserID = userID
p := path.Join("channels", url.PathEscape(ch.Type), url.PathEscape(ch.ID), "message")

req := message.toRequest()
Expand Down

0 comments on commit 72ef6ee

Please sign in to comment.