Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: payload for sendmessage to prevent upsert user #273

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -94,7 +95,7 @@ func (m *Message) toRequest() messageRequest {
Text: m.Text,
Type: m.Type,
Attachments: m.Attachments,
User: messageRequestUser{ID: m.User.ID},
UserID: m.UserID,
ExtraData: m.ExtraData,
Pinned: m.Pinned,
ParentID: m.ParentID,
Expand Down Expand Up @@ -128,6 +129,7 @@ type messageRequestMessage struct {
Type MessageType `json:"type" validate:"omitempty,oneof=system"`
Attachments []*Attachment `json:"attachments"`
User messageRequestUser `json:"user"`
UserID string `json:"user_id"`
MentionedUsers []string `json:"mentioned_users"`
ParentID string `json:"parent_id"`
ShowInChannel bool `json:"show_in_channel"`
Expand Down
Loading