Skip to content

Commit

Permalink
Message: uploads, old_style_attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Oct 27, 2020
1 parent 184ee2b commit 3df57d1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
20 changes: 13 additions & 7 deletions client_message_updated.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,33 @@ type ClientMessageUpdated struct {
func (p ClientMessageUpdated) GetName() string { return "client.message.updated" }

type ClientMessageUpdatedParams struct {
// chat, task or contact jid. Required.
// Chat, task or contact jid. Required.
To JID `json:"to"`

// message content. Required.
// Message content. Required.
Content MessageContent `json:"content"`

// uid created by client. Recommended.
// Uid created by client. Recommended.
MessageId string `json:"message_id,omitempty"`

// Replied to message id. Not required.
ReplyTo string `json:"reply_to,omitempty"`

// forwarded messages (previously was for reply too). Not required.
// Forwarded messages (previously was for reply too). Not required.
LinkedMessages []string `json:"linked_messages,omitempty"`

// important flag. Not required. Default: false
// Important flag. Not required. Default: false
Important bool `json:"important,omitempty"`

// disable links preview generation. Not required. Default: false
// Disable links preview generation. Not required. Default: false
Nopreview bool `json:"nopreview,omitempty"`

// deprecated
// Message attachments
Uploads []string `json:"uploads,omitempty"`

// Backward compatibility mode
OldStyleAttachment bool `json:"old_style_attachment,omitempty"`

// Deprecated
Comment string `json:"comment,omitempty"`
}
21 changes: 18 additions & 3 deletions tdapi/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,29 @@ package tdapi
import "github.com/tada-team/tdproto"

type MessageUpdate struct {
// Important flag. Not required. Default: false
Important bool `json:"important,omitempty"`

// Disable links preview generation. Not required. Default: false
Nopreview bool `json:"nopreview,omitempty"`
}

type Message struct {
Mediatype tdproto.Mediatype `json:"type"`
Text string `json:"text"`
MessageUid string `json:"message_id,omitempty"`
// Message type
Type tdproto.Mediatype `json:"type"`

// Message text
Text string `json:"text"`

// Message id
MessageUid string `json:"message_id,omitempty"`

// Message attachments
Uploads []string `json:"uploads,omitempty"`

// Backward compatibility mode
OldStyleAttachment bool `json:"old_style_attachment,omitempty"`

MessageUpdate
}

Expand Down

0 comments on commit 3df57d1

Please sign in to comment.