mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-21 20:20:17 +01:00
Update to TDLib 1.8.50
This commit is contained in:
parent
969ddb4746
commit
bc2b5f5823
4 changed files with 1133 additions and 109 deletions
|
|
@ -1672,6 +1672,35 @@ func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Message
|
|||
return UnmarshalMessageViewers(result.Data)
|
||||
}
|
||||
|
||||
type GetMessageAuthorRequest struct {
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the message
|
||||
MessageId int64 `json:"message_id"`
|
||||
}
|
||||
|
||||
// Returns information about actual author of a message sent on behalf of a channel. The method can be called if messageProperties.can_get_author == true
|
||||
func (client *Client) GetMessageAuthor(req *GetMessageAuthorRequest) (*User, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getMessageAuthor",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"message_id": req.MessageId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalUser(result.Data)
|
||||
}
|
||||
|
||||
type GetFileRequest struct {
|
||||
// Identifier of the file to get
|
||||
FileId int32 `json:"file_id"`
|
||||
|
|
@ -2387,7 +2416,7 @@ func (client *Client) GetSuitableDiscussionChats() (*Chats, error) {
|
|||
return UnmarshalChats(result.Data)
|
||||
}
|
||||
|
||||
// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium
|
||||
// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives the error "CHANNELS_TOO_MUCH". Also, the limit can be increased with Telegram Premium
|
||||
func (client *Client) GetInactiveSupergroupChats() (*Chats, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -2425,6 +2454,320 @@ func (client *Client) GetSuitablePersonalChats() (*Chats, error) {
|
|||
return UnmarshalChats(result.Data)
|
||||
}
|
||||
|
||||
type LoadDirectMessagesChatTopicsRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached
|
||||
Limit int32 `json:"limit"`
|
||||
}
|
||||
|
||||
// Loads more topics in a channel direct messages chat administered by the current user. The loaded topics will be sent through updateDirectMessagesChatTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded
|
||||
func (client *Client) LoadDirectMessagesChatTopics(req *LoadDirectMessagesChatTopicsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "loadDirectMessagesChatTopics",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"limit": req.Limit,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type GetDirectMessagesChatTopicRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the topic to get
|
||||
TopicId int64 `json:"topic_id"`
|
||||
}
|
||||
|
||||
// Returns information about the topic in a channel direct messages chat administered by the current user
|
||||
func (client *Client) GetDirectMessagesChatTopic(req *GetDirectMessagesChatTopicRequest) (*DirectMessagesChatTopic, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getDirectMessagesChatTopic",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalDirectMessagesChatTopic(result.Data)
|
||||
}
|
||||
|
||||
type GetDirectMessagesChatTopicHistoryRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the topic which messages will be fetched
|
||||
TopicId int64 `json:"topic_id"`
|
||||
// Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message
|
||||
FromMessageId int64 `json:"from_message_id"`
|
||||
// Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages
|
||||
Offset int32 `json:"offset"`
|
||||
// The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
|
||||
Limit int32 `json:"limit"`
|
||||
}
|
||||
|
||||
// Returns messages in the topic in a channel direct messages chat administered by the current user. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id)
|
||||
func (client *Client) GetDirectMessagesChatTopicHistory(req *GetDirectMessagesChatTopicHistoryRequest) (*Messages, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getDirectMessagesChatTopicHistory",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"from_message_id": req.FromMessageId,
|
||||
"offset": req.Offset,
|
||||
"limit": req.Limit,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalMessages(result.Data)
|
||||
}
|
||||
|
||||
type GetDirectMessagesChatTopicMessageByDateRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the topic which messages will be fetched
|
||||
TopicId int64 `json:"topic_id"`
|
||||
// Point in time (Unix timestamp) relative to which to search for messages
|
||||
Date int32 `json:"date"`
|
||||
}
|
||||
|
||||
// Returns the last message sent in the topic in a channel direct messages chat administered by the current user no later than the specified date
|
||||
func (client *Client) GetDirectMessagesChatTopicMessageByDate(req *GetDirectMessagesChatTopicMessageByDateRequest) (*Message, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "getDirectMessagesChatTopicMessageByDate",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"date": req.Date,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalMessage(result.Data)
|
||||
}
|
||||
|
||||
type DeleteDirectMessagesChatTopicHistoryRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the topic which messages will be deleted
|
||||
TopicId int64 `json:"topic_id"`
|
||||
}
|
||||
|
||||
// Deletes all messages in the topic in a channel direct messages chat administered by the current user
|
||||
func (client *Client) DeleteDirectMessagesChatTopicHistory(req *DeleteDirectMessagesChatTopicHistoryRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "deleteDirectMessagesChatTopicHistory",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type DeleteDirectMessagesChatTopicMessagesByDateRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the topic which messages will be deleted
|
||||
TopicId int64 `json:"topic_id"`
|
||||
// The minimum date of the messages to delete
|
||||
MinDate int32 `json:"min_date"`
|
||||
// The maximum date of the messages to delete
|
||||
MaxDate int32 `json:"max_date"`
|
||||
}
|
||||
|
||||
// Deletes all messages between the specified dates in the topic in a channel direct messages chat administered by the current user. Messages sent in the last 30 seconds will not be deleted
|
||||
func (client *Client) DeleteDirectMessagesChatTopicMessagesByDate(req *DeleteDirectMessagesChatTopicMessagesByDateRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "deleteDirectMessagesChatTopicMessagesByDate",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"min_date": req.MinDate,
|
||||
"max_date": req.MaxDate,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetDirectMessagesChatTopicIsMarkedAsUnreadRequest struct {
|
||||
// Chat identifier of the channel direct messages chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Topic identifier
|
||||
TopicId int64 `json:"topic_id"`
|
||||
// New value of is_marked_as_unread
|
||||
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
|
||||
}
|
||||
|
||||
// Changes the marked as unread state of the topic in a channel direct messages chat administered by the current user
|
||||
func (client *Client) SetDirectMessagesChatTopicIsMarkedAsUnread(req *SetDirectMessagesChatTopicIsMarkedAsUnreadRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setDirectMessagesChatTopicIsMarkedAsUnread",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"is_marked_as_unread": req.IsMarkedAsUnread,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetDirectMessagesChatTopicDraftMessageRequest struct {
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Topic identifier
|
||||
TopicId int64 `json:"topic_id"`
|
||||
// New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored
|
||||
DraftMessage *DraftMessage `json:"draft_message"`
|
||||
}
|
||||
|
||||
// Changes the draft message in the topic in a channel direct messages chat administered by the current user
|
||||
func (client *Client) SetDirectMessagesChatTopicDraftMessage(req *SetDirectMessagesChatTopicDraftMessageRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setDirectMessagesChatTopicDraftMessage",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"draft_message": req.DraftMessage,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type UnpinAllDirectMessagesChatTopicMessagesRequest struct {
|
||||
// Identifier of the chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Topic identifier
|
||||
TopicId int64 `json:"topic_id"`
|
||||
}
|
||||
|
||||
// Removes all pinned messages from the topic in a channel direct messages chat administered by the current user
|
||||
func (client *Client) UnpinAllDirectMessagesChatTopicMessages(req *UnpinAllDirectMessagesChatTopicMessagesRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "unpinAllDirectMessagesChatTopicMessages",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type ReadAllDirectMessagesChatTopicReactionsRequest struct {
|
||||
// Identifier of the chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Topic identifier
|
||||
TopicId int64 `json:"topic_id"`
|
||||
}
|
||||
|
||||
// Removes all unread reactions in the topic in a channel direct messages chat administered by the current user
|
||||
func (client *Client) ReadAllDirectMessagesChatTopicReactions(req *ReadAllDirectMessagesChatTopicReactionsRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "readAllDirectMessagesChatTopicReactions",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type LoadSavedMessagesTopicsRequest struct {
|
||||
// The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached
|
||||
Limit int32 `json:"limit"`
|
||||
|
|
@ -2797,6 +3140,8 @@ func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) {
|
|||
type SearchChatMessagesRequest struct {
|
||||
// Identifier of the chat in which to search messages
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Pass topic identifier to search messages only in specific topic; pass null to search for messages in all topics
|
||||
TopicId MessageTopic `json:"topic_id"`
|
||||
// Query to search for
|
||||
Query string `json:"query"`
|
||||
// Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats
|
||||
|
|
@ -2809,13 +3154,9 @@ type SearchChatMessagesRequest struct {
|
|||
Limit int32 `json:"limit"`
|
||||
// Additional filter for messages to search; pass null to search for all messages
|
||||
Filter SearchMessagesFilter `json:"filter"`
|
||||
// If not 0, only messages in the specified thread will be returned; supergroups only
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// If not 0, only messages in the specified Saved Messages topic will be returned; pass 0 to return all messages, or for chats other than Saved Messages
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
}
|
||||
|
||||
// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation
|
||||
// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and topic_id search criteria is expected to be supported, only if it is required for Telegram official application implementation
|
||||
func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*FoundChatMessages, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -2823,14 +3164,13 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Found
|
|||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"query": req.Query,
|
||||
"sender_id": req.SenderId,
|
||||
"from_message_id": req.FromMessageId,
|
||||
"offset": req.Offset,
|
||||
"limit": req.Limit,
|
||||
"filter": req.Filter,
|
||||
"message_thread_id": req.MessageThreadId,
|
||||
"saved_messages_topic_id": req.SavedMessagesTopicId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -3371,12 +3711,12 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos
|
|||
type GetChatMessageCalendarRequest struct {
|
||||
// Identifier of the chat in which to return information about messages
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Pass topic identifier to get the result only in specific topic; pass null to get the result in all topics; forum topics aren't supported
|
||||
TopicId MessageTopic `json:"topic_id"`
|
||||
// Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
|
||||
Filter SearchMessagesFilter `json:"filter"`
|
||||
// The message identifier from which to return information about messages; use 0 to get results from the last message
|
||||
FromMessageId int64 `json:"from_message_id"`
|
||||
// If not0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
}
|
||||
|
||||
// Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset"
|
||||
|
|
@ -3387,9 +3727,9 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest)
|
|||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"filter": req.Filter,
|
||||
"from_message_id": req.FromMessageId,
|
||||
"saved_messages_topic_id": req.SavedMessagesTopicId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -3406,15 +3746,15 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest)
|
|||
type GetChatMessageCountRequest struct {
|
||||
// Identifier of the chat in which to count messages
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Pass topic identifier to get number of messages only in specific topic; pass null to get number of messages in all topics
|
||||
TopicId MessageTopic `json:"topic_id"`
|
||||
// Filter for message content; searchMessagesFilterEmpty is unsupported in this function
|
||||
Filter SearchMessagesFilter `json:"filter"`
|
||||
// If not 0, only messages in the specified Saved Messages topic will be counted; pass 0 to count all messages, or for chats other than Saved Messages
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
// Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally
|
||||
ReturnLocal bool `json:"return_local"`
|
||||
}
|
||||
|
||||
// Returns approximate number of messages of the specified type in the chat
|
||||
// Returns approximate number of messages of the specified type in the chat or its topic
|
||||
func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Count, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -3422,8 +3762,8 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou
|
|||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"topic_id": req.TopicId,
|
||||
"filter": req.Filter,
|
||||
"saved_messages_topic_id": req.SavedMessagesTopicId,
|
||||
"return_local": req.ReturnLocal,
|
||||
},
|
||||
})
|
||||
|
|
@ -3441,17 +3781,15 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou
|
|||
type GetChatMessagePositionRequest struct {
|
||||
// Identifier of the chat in which to find message position
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Message identifier
|
||||
MessageId int64 `json:"message_id"`
|
||||
// Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages
|
||||
TopicId MessageTopic `json:"topic_id"`
|
||||
// Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function
|
||||
Filter SearchMessagesFilter `json:"filter"`
|
||||
// If not 0, only messages in the specified thread will be considered; supergroups only
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
// Message identifier
|
||||
MessageId int64 `json:"message_id"`
|
||||
}
|
||||
|
||||
// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats
|
||||
// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat and topic. Cannot be used in secret chats
|
||||
func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) (*Count, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
|
|
@ -3459,10 +3797,9 @@ func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest)
|
|||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"message_id": req.MessageId,
|
||||
"topic_id": req.TopicId,
|
||||
"filter": req.Filter,
|
||||
"message_thread_id": req.MessageThreadId,
|
||||
"saved_messages_topic_id": req.SavedMessagesTopicId,
|
||||
"message_id": req.MessageId,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -4235,7 +4572,7 @@ type ForwardMessagesRequest struct {
|
|||
MessageIds []int64 `json:"message_ids"`
|
||||
// Options to be used to send the messages; pass null to use default options
|
||||
Options *MessageSendOptions `json:"options"`
|
||||
// Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local. Use messageProperties.can_be_saved and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable
|
||||
// Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local. Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable
|
||||
SendCopy bool `json:"send_copy"`
|
||||
// Pass true to remove media captions of message copies. Ignored if send_copy is false
|
||||
RemoveCaption bool `json:"remove_caption"`
|
||||
|
|
@ -4362,7 +4699,7 @@ func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreensho
|
|||
}
|
||||
|
||||
type AddLocalMessageRequest struct {
|
||||
// Target chat
|
||||
// Target chat; channel direct messages chats aren't supported
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the sender of the message
|
||||
SenderId MessageSender `json:"sender_id"`
|
||||
|
|
@ -7976,8 +8313,10 @@ type OpenWebAppRequest struct {
|
|||
BotUserId int64 `json:"bot_user_id"`
|
||||
// The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise
|
||||
Url string `json:"url"`
|
||||
// If not 0, the message thread identifier in which the message will be sent
|
||||
// If not 0, the message thread identifier to which the message will be sent
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// If not 0, unique identifier of the topic of channel direct messages chat to which the message will be sent
|
||||
DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"`
|
||||
// Information about the message or story to be replied in the message sent by the Web App; pass null if none
|
||||
ReplyTo InputMessageReplyTo `json:"reply_to"`
|
||||
// Parameters to use to open the Web App
|
||||
|
|
@ -7995,6 +8334,7 @@ func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) {
|
|||
"bot_user_id": req.BotUserId,
|
||||
"url": req.Url,
|
||||
"message_thread_id": req.MessageThreadId,
|
||||
"direct_messages_chat_topic_id": req.DirectMessagesChatTopicId,
|
||||
"reply_to": req.ReplyTo,
|
||||
"parameters": req.Parameters,
|
||||
},
|
||||
|
|
@ -10449,6 +10789,38 @@ func (client *Client) SetChatDiscussionGroup(req *SetChatDiscussionGroupRequest)
|
|||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetChatDirectMessagesGroupRequest struct {
|
||||
// Identifier of the channel chat
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Pass true if the direct messages group is enabled for the channel chat; pass false otherwise
|
||||
IsEnabled bool `json:"is_enabled"`
|
||||
// The new number of Telegram Stars that must be paid for each message that is sent to the direct messages chat unless the sender is an administrator of the channel chat; 0-getOption("paid_message_star_count_max"). The channel will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending. Requires supergroupFullInfo.can_enable_paid_messages for positive amounts
|
||||
PaidMessageStarCount int64 `json:"paid_message_star_count"`
|
||||
}
|
||||
|
||||
// Changes direct messages group settings for a channel chat; requires owner privileges in the chat
|
||||
func (client *Client) SetChatDirectMessagesGroup(req *SetChatDirectMessagesGroupRequest) (*Ok, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setChatDirectMessagesGroup",
|
||||
},
|
||||
Data: map[string]interface{}{
|
||||
"chat_id": req.ChatId,
|
||||
"is_enabled": req.IsEnabled,
|
||||
"paid_message_star_count": req.PaidMessageStarCount,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.Type == "error" {
|
||||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
}
|
||||
|
||||
type SetChatLocationRequest struct {
|
||||
// Chat identifier
|
||||
ChatId int64 `json:"chat_id"`
|
||||
|
|
@ -13114,7 +13486,7 @@ func (client *Client) SearchFileDownloads(req *SearchFileDownloadsRequest) (*Fou
|
|||
type SetApplicationVerificationTokenRequest struct {
|
||||
// Unique identifier for the verification process as received from updateApplicationVerificationRequired or updateApplicationRecaptchaVerificationRequired
|
||||
VerificationId int64 `json:"verification_id"`
|
||||
// Play Integrity API token for the Android application, or secret from push notification for the iOS application for application verification, or reCAPTCHA token for reCAPTCHA verifications; pass an empty string to abort verification and receive error VERIFICATION_FAILED for the request
|
||||
// Play Integrity API token for the Android application, or secret from push notification for the iOS application for application verification, or reCAPTCHA token for reCAPTCHA verifications; pass an empty string to abort verification and receive the error "VERIFICATION_FAILED" for the request
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
|
|
@ -14779,8 +15151,8 @@ type SetGroupCallParticipantIsSpeakingRequest struct {
|
|||
IsSpeaking bool `json:"is_speaking"`
|
||||
}
|
||||
|
||||
// Informs TDLib that speaking state of a participant of an active group call has changed
|
||||
func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallParticipantIsSpeakingRequest) (*Ok, error) {
|
||||
// Informs TDLib that speaking state of a participant of an active group call has changed. Returns identifier of the participant if it is found
|
||||
func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallParticipantIsSpeakingRequest) (MessageSender, error) {
|
||||
result, err := client.Send(Request{
|
||||
meta: meta{
|
||||
Type: "setGroupCallParticipantIsSpeaking",
|
||||
|
|
@ -14799,7 +15171,16 @@ func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallPartici
|
|||
return nil, buildResponseError(result.Data)
|
||||
}
|
||||
|
||||
return UnmarshalOk(result.Data)
|
||||
switch result.Type {
|
||||
case TypeMessageSenderUser:
|
||||
return UnmarshalMessageSenderUser(result.Data)
|
||||
|
||||
case TypeMessageSenderChat:
|
||||
return UnmarshalMessageSenderChat(result.Data)
|
||||
|
||||
default:
|
||||
return nil, errors.New("invalid type")
|
||||
}
|
||||
}
|
||||
|
||||
type ToggleGroupCallParticipantIsMutedRequest struct {
|
||||
|
|
@ -19258,6 +19639,8 @@ type ToggleSupergroupIsForumRequest struct {
|
|||
SupergroupId int64 `json:"supergroup_id"`
|
||||
// New value of is_forum
|
||||
IsForum bool `json:"is_forum"`
|
||||
// New value of has_forum_tabs; ignored if is_forum is false
|
||||
HasForumTabs bool `json:"has_forum_tabs"`
|
||||
}
|
||||
|
||||
// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums
|
||||
|
|
@ -19269,6 +19652,7 @@ func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumReques
|
|||
Data: map[string]interface{}{
|
||||
"supergroup_id": req.SupergroupId,
|
||||
"is_forum": req.IsForum,
|
||||
"has_forum_tabs": req.HasForumTabs,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -25371,6 +25755,12 @@ func (client *Client) TestUseUpdate() (Update, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(result.Data)
|
||||
|
||||
case TypeUpdateDirectMessagesChatTopic:
|
||||
return UnmarshalUpdateDirectMessagesChatTopic(result.Data)
|
||||
|
||||
case TypeUpdateTopicMessageCount:
|
||||
return UnmarshalUpdateTopicMessageCount(result.Data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(result.Data)
|
||||
|
||||
|
|
|
|||
407
client/type.go
407
client/type.go
|
|
@ -45,6 +45,7 @@ const (
|
|||
ClassMessageOrigin = "MessageOrigin"
|
||||
ClassReactionType = "ReactionType"
|
||||
ClassPaidReactionType = "PaidReactionType"
|
||||
ClassMessageTopic = "MessageTopic"
|
||||
ClassMessageEffectType = "MessageEffectType"
|
||||
ClassMessageSendingState = "MessageSendingState"
|
||||
ClassMessageReplyTo = "MessageReplyTo"
|
||||
|
|
@ -400,6 +401,7 @@ const (
|
|||
ClassWebAppOpenParameters = "WebAppOpenParameters"
|
||||
ClassMessageThreadInfo = "MessageThreadInfo"
|
||||
ClassSavedMessagesTopic = "SavedMessagesTopic"
|
||||
ClassDirectMessagesChatTopic = "DirectMessagesChatTopic"
|
||||
ClassForumTopicIcon = "ForumTopicIcon"
|
||||
ClassForumTopicInfo = "ForumTopicInfo"
|
||||
ClassForumTopic = "ForumTopic"
|
||||
|
|
@ -965,6 +967,9 @@ const (
|
|||
TypeMessageReactions = "messageReactions"
|
||||
TypeMessageInteractionInfo = "messageInteractionInfo"
|
||||
TypeUnreadReaction = "unreadReaction"
|
||||
TypeMessageTopicForum = "messageTopicForum"
|
||||
TypeMessageTopicDirectMessages = "messageTopicDirectMessages"
|
||||
TypeMessageTopicSavedMessages = "messageTopicSavedMessages"
|
||||
TypeMessageEffectTypeEmojiReaction = "messageEffectTypeEmojiReaction"
|
||||
TypeMessageEffectTypePremiumSticker = "messageEffectTypePremiumSticker"
|
||||
TypeMessageEffect = "messageEffect"
|
||||
|
|
@ -991,6 +996,7 @@ const (
|
|||
TypeMessageSourceChatHistory = "messageSourceChatHistory"
|
||||
TypeMessageSourceMessageThreadHistory = "messageSourceMessageThreadHistory"
|
||||
TypeMessageSourceForumTopicHistory = "messageSourceForumTopicHistory"
|
||||
TypeMessageSourceDirectMessagesChatTopicHistory = "messageSourceDirectMessagesChatTopicHistory"
|
||||
TypeMessageSourceHistoryPreview = "messageSourceHistoryPreview"
|
||||
TypeMessageSourceChatList = "messageSourceChatList"
|
||||
TypeMessageSourceSearch = "messageSourceSearch"
|
||||
|
|
@ -1101,6 +1107,7 @@ const (
|
|||
TypeSavedMessagesTopicTypeAuthorHidden = "savedMessagesTopicTypeAuthorHidden"
|
||||
TypeSavedMessagesTopicTypeSavedFromChat = "savedMessagesTopicTypeSavedFromChat"
|
||||
TypeSavedMessagesTopic = "savedMessagesTopic"
|
||||
TypeDirectMessagesChatTopic = "directMessagesChatTopic"
|
||||
TypeForumTopicIcon = "forumTopicIcon"
|
||||
TypeForumTopicInfo = "forumTopicInfo"
|
||||
TypeForumTopic = "forumTopic"
|
||||
|
|
@ -1384,6 +1391,7 @@ const (
|
|||
TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift"
|
||||
TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded"
|
||||
TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged"
|
||||
TypeMessageDirectMessagePriceChanged = "messageDirectMessagePriceChanged"
|
||||
TypeMessageContactRegistered = "messageContactRegistered"
|
||||
TypeMessageUsersShared = "messageUsersShared"
|
||||
TypeMessageChatShared = "messageChatShared"
|
||||
|
|
@ -2273,6 +2281,8 @@ const (
|
|||
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
|
||||
TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic"
|
||||
TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount"
|
||||
TypeUpdateDirectMessagesChatTopic = "updateDirectMessagesChatTopic"
|
||||
TypeUpdateTopicMessageCount = "updateTopicMessageCount"
|
||||
TypeUpdateQuickReplyShortcut = "updateQuickReplyShortcut"
|
||||
TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted"
|
||||
TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts"
|
||||
|
|
@ -2584,6 +2594,11 @@ type PaidReactionType interface {
|
|||
PaidReactionTypeType() string
|
||||
}
|
||||
|
||||
// Describes a topic of messages in a chat
|
||||
type MessageTopic interface {
|
||||
MessageTopicType() string
|
||||
}
|
||||
|
||||
// Describes type of emoji effect
|
||||
type MessageEffectType interface {
|
||||
MessageEffectTypeType() string
|
||||
|
|
@ -7626,11 +7641,11 @@ func (*ChatPermissions) GetType() string {
|
|||
// Describes rights of the administrator
|
||||
type ChatAdministratorRights struct {
|
||||
meta
|
||||
// True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only
|
||||
// True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other privilege; applicable to supergroups and channels only
|
||||
CanManageChat bool `json:"can_manage_chat"`
|
||||
// True, if the administrator can change the chat title, photo, and other settings
|
||||
CanChangeInfo bool `json:"can_change_info"`
|
||||
// True, if the administrator can create channel posts or view channel statistics; applicable to channels only
|
||||
// True, if the administrator can create channel posts, answer to channel direct messages, or view channel statistics; applicable to channels only
|
||||
CanPostMessages bool `json:"can_post_messages"`
|
||||
// True, if the administrator can edit messages of other users and pin messages; applicable to channels only
|
||||
CanEditMessages bool `json:"can_edit_messages"`
|
||||
|
|
@ -10639,7 +10654,7 @@ func (*StarTransactionTypePaidMessageSend) StarTransactionTypeType() string {
|
|||
return TypeStarTransactionTypePaidMessageSend
|
||||
}
|
||||
|
||||
// The transaction is a receiving of a paid message; for regular users and supergroup chats only
|
||||
// The transaction is a receiving of a paid message; for regular users, supergroup and channel chats only
|
||||
type StarTransactionTypePaidMessageReceive struct {
|
||||
meta
|
||||
// Identifier of the sender of the message
|
||||
|
|
@ -13165,8 +13180,16 @@ type Supergroup struct {
|
|||
IsBroadcastGroup bool `json:"is_broadcast_group"`
|
||||
// True, if the supergroup is a forum with topics
|
||||
IsForum bool `json:"is_forum"`
|
||||
// True, if the supergroup is a direct message group for a channel chat
|
||||
IsDirectMessagesGroup bool `json:"is_direct_messages_group"`
|
||||
// True, if the supergroup is a direct messages group for a channel chat that is administered by the current user
|
||||
IsAdministeredDirectMessagesGroup bool `json:"is_administered_direct_messages_group"`
|
||||
// Information about verification status of the supergroup or channel; may be null if none
|
||||
VerificationStatus *VerificationStatus `json:"verification_status"`
|
||||
// True, if the channel has direct messages group
|
||||
HasDirectMessagesGroup bool `json:"has_direct_messages_group"`
|
||||
// True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups
|
||||
HasForumTabs bool `json:"has_forum_tabs"`
|
||||
// True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler
|
||||
HasSensitiveContent bool `json:"has_sensitive_content"`
|
||||
// If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
|
||||
|
|
@ -13215,7 +13238,11 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
|
|||
IsChannel bool `json:"is_channel"`
|
||||
IsBroadcastGroup bool `json:"is_broadcast_group"`
|
||||
IsForum bool `json:"is_forum"`
|
||||
IsDirectMessagesGroup bool `json:"is_direct_messages_group"`
|
||||
IsAdministeredDirectMessagesGroup bool `json:"is_administered_direct_messages_group"`
|
||||
VerificationStatus *VerificationStatus `json:"verification_status"`
|
||||
HasDirectMessagesGroup bool `json:"has_direct_messages_group"`
|
||||
HasForumTabs bool `json:"has_forum_tabs"`
|
||||
HasSensitiveContent bool `json:"has_sensitive_content"`
|
||||
RestrictionReason string `json:"restriction_reason"`
|
||||
PaidMessageStarCount int64 `json:"paid_message_star_count"`
|
||||
|
|
@ -13245,7 +13272,11 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
|
|||
supergroup.IsChannel = tmp.IsChannel
|
||||
supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup
|
||||
supergroup.IsForum = tmp.IsForum
|
||||
supergroup.IsDirectMessagesGroup = tmp.IsDirectMessagesGroup
|
||||
supergroup.IsAdministeredDirectMessagesGroup = tmp.IsAdministeredDirectMessagesGroup
|
||||
supergroup.VerificationStatus = tmp.VerificationStatus
|
||||
supergroup.HasDirectMessagesGroup = tmp.HasDirectMessagesGroup
|
||||
supergroup.HasForumTabs = tmp.HasForumTabs
|
||||
supergroup.HasSensitiveContent = tmp.HasSensitiveContent
|
||||
supergroup.RestrictionReason = tmp.RestrictionReason
|
||||
supergroup.PaidMessageStarCount = tmp.PaidMessageStarCount
|
||||
|
|
@ -13275,6 +13306,8 @@ type SupergroupFullInfo struct {
|
|||
BannedCount int32 `json:"banned_count"`
|
||||
// Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown
|
||||
LinkedChatId int64 `json:"linked_chat_id"`
|
||||
// Chat identifier of a direct messages group for the channel, or a channel, for which the supergroup is the designated direct messages group; 0 if none
|
||||
DirectMessagesChatId int64 `json:"direct_messages_chat_id"`
|
||||
// Delay between consecutive sent messages for non-administrator supergroup members, in seconds
|
||||
SlowModeDelay int32 `json:"slow_mode_delay"`
|
||||
// Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
|
||||
|
|
@ -14515,6 +14548,87 @@ func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// A topic in a forum supergroup chat
|
||||
type MessageTopicForum struct {
|
||||
meta
|
||||
// Unique identifier of the forum topic; all messages in a non-forum supergroup chats belongs to the General topic
|
||||
ForumTopicId int64 `json:"forum_topic_id"`
|
||||
}
|
||||
|
||||
func (entity *MessageTopicForum) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageTopicForum
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageTopicForum) GetClass() string {
|
||||
return ClassMessageTopic
|
||||
}
|
||||
|
||||
func (*MessageTopicForum) GetType() string {
|
||||
return TypeMessageTopicForum
|
||||
}
|
||||
|
||||
func (*MessageTopicForum) MessageTopicType() string {
|
||||
return TypeMessageTopicForum
|
||||
}
|
||||
|
||||
// A topic in a channel direct messages chat administered by the current user
|
||||
type MessageTopicDirectMessages struct {
|
||||
meta
|
||||
// Unique identifier of the topic
|
||||
DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"`
|
||||
}
|
||||
|
||||
func (entity *MessageTopicDirectMessages) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageTopicDirectMessages
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageTopicDirectMessages) GetClass() string {
|
||||
return ClassMessageTopic
|
||||
}
|
||||
|
||||
func (*MessageTopicDirectMessages) GetType() string {
|
||||
return TypeMessageTopicDirectMessages
|
||||
}
|
||||
|
||||
func (*MessageTopicDirectMessages) MessageTopicType() string {
|
||||
return TypeMessageTopicDirectMessages
|
||||
}
|
||||
|
||||
// A topic in Saved Messages chat
|
||||
type MessageTopicSavedMessages struct {
|
||||
meta
|
||||
// Unique identifier of the Saved Messages topic
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
}
|
||||
|
||||
func (entity *MessageTopicSavedMessages) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageTopicSavedMessages
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageTopicSavedMessages) GetClass() string {
|
||||
return ClassMessageTopic
|
||||
}
|
||||
|
||||
func (*MessageTopicSavedMessages) GetType() string {
|
||||
return TypeMessageTopicSavedMessages
|
||||
}
|
||||
|
||||
func (*MessageTopicSavedMessages) MessageTopicType() string {
|
||||
return TypeMessageTopicSavedMessages
|
||||
}
|
||||
|
||||
// An effect from an emoji reaction
|
||||
type MessageEffectTypeEmojiReaction struct {
|
||||
meta
|
||||
|
|
@ -14973,14 +15087,12 @@ type Message struct {
|
|||
IsPinned bool `json:"is_pinned"`
|
||||
// True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message
|
||||
IsFromOffline bool `json:"is_from_offline"`
|
||||
// True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options
|
||||
// True, if content of the message can be saved locally
|
||||
CanBeSaved bool `json:"can_be_saved"`
|
||||
// True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
|
||||
HasTimestampedMedia bool `json:"has_timestamped_media"`
|
||||
// True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
|
||||
IsChannelPost bool `json:"is_channel_post"`
|
||||
// True, if the message is a forum topic message
|
||||
IsTopicMessage bool `json:"is_topic_message"`
|
||||
// True, if the message contains an unread mention for the current user
|
||||
ContainsUnreadMention bool `json:"contains_unread_mention"`
|
||||
// Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages
|
||||
|
|
@ -15001,8 +15113,8 @@ type Message struct {
|
|||
ReplyTo MessageReplyTo `json:"reply_to"`
|
||||
// If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
// Identifier of the topic within the chat to which the message belongs; may be null if none
|
||||
TopicId MessageTopic `json:"topic_id"`
|
||||
// The message's self-destruct type; may be null if none
|
||||
SelfDestructType MessageSelfDestructType `json:"self_destruct_type"`
|
||||
// Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet
|
||||
|
|
@ -15062,7 +15174,6 @@ func (message *Message) UnmarshalJSON(data []byte) error {
|
|||
CanBeSaved bool `json:"can_be_saved"`
|
||||
HasTimestampedMedia bool `json:"has_timestamped_media"`
|
||||
IsChannelPost bool `json:"is_channel_post"`
|
||||
IsTopicMessage bool `json:"is_topic_message"`
|
||||
ContainsUnreadMention bool `json:"contains_unread_mention"`
|
||||
Date int32 `json:"date"`
|
||||
EditDate int32 `json:"edit_date"`
|
||||
|
|
@ -15073,7 +15184,7 @@ func (message *Message) UnmarshalJSON(data []byte) error {
|
|||
FactCheck *FactCheck `json:"fact_check"`
|
||||
ReplyTo json.RawMessage `json:"reply_to"`
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
||||
TopicId json.RawMessage `json:"topic_id"`
|
||||
SelfDestructType json.RawMessage `json:"self_destruct_type"`
|
||||
SelfDestructIn float64 `json:"self_destruct_in"`
|
||||
AutoDeleteIn float64 `json:"auto_delete_in"`
|
||||
|
|
@ -15103,7 +15214,6 @@ func (message *Message) UnmarshalJSON(data []byte) error {
|
|||
message.CanBeSaved = tmp.CanBeSaved
|
||||
message.HasTimestampedMedia = tmp.HasTimestampedMedia
|
||||
message.IsChannelPost = tmp.IsChannelPost
|
||||
message.IsTopicMessage = tmp.IsTopicMessage
|
||||
message.ContainsUnreadMention = tmp.ContainsUnreadMention
|
||||
message.Date = tmp.Date
|
||||
message.EditDate = tmp.EditDate
|
||||
|
|
@ -15113,7 +15223,6 @@ func (message *Message) UnmarshalJSON(data []byte) error {
|
|||
message.UnreadReactions = tmp.UnreadReactions
|
||||
message.FactCheck = tmp.FactCheck
|
||||
message.MessageThreadId = tmp.MessageThreadId
|
||||
message.SavedMessagesTopicId = tmp.SavedMessagesTopicId
|
||||
message.SelfDestructIn = tmp.SelfDestructIn
|
||||
message.AutoDeleteIn = tmp.AutoDeleteIn
|
||||
message.ViaBotUserId = tmp.ViaBotUserId
|
||||
|
|
@ -15138,6 +15247,9 @@ func (message *Message) UnmarshalJSON(data []byte) error {
|
|||
fieldReplyTo, _ := UnmarshalMessageReplyTo(tmp.ReplyTo)
|
||||
message.ReplyTo = fieldReplyTo
|
||||
|
||||
fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId)
|
||||
message.TopicId = fieldTopicId
|
||||
|
||||
fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType)
|
||||
message.SelfDestructType = fieldSelfDestructType
|
||||
|
||||
|
|
@ -15404,7 +15516,7 @@ func (*MessageSourceChatHistory) MessageSourceType() string {
|
|||
return TypeMessageSourceChatHistory
|
||||
}
|
||||
|
||||
// The message is from a message thread history
|
||||
// The message is from history of a message thread
|
||||
type MessageSourceMessageThreadHistory struct{
|
||||
meta
|
||||
}
|
||||
|
|
@ -15429,7 +15541,7 @@ func (*MessageSourceMessageThreadHistory) MessageSourceType() string {
|
|||
return TypeMessageSourceMessageThreadHistory
|
||||
}
|
||||
|
||||
// The message is from a forum topic history
|
||||
// The message is from history of a forum topic
|
||||
type MessageSourceForumTopicHistory struct{
|
||||
meta
|
||||
}
|
||||
|
|
@ -15454,6 +15566,31 @@ func (*MessageSourceForumTopicHistory) MessageSourceType() string {
|
|||
return TypeMessageSourceForumTopicHistory
|
||||
}
|
||||
|
||||
// The message is from history of a topic in a channel direct messages chat administered by the current user
|
||||
type MessageSourceDirectMessagesChatTopicHistory struct{
|
||||
meta
|
||||
}
|
||||
|
||||
func (entity *MessageSourceDirectMessagesChatTopicHistory) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageSourceDirectMessagesChatTopicHistory
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageSourceDirectMessagesChatTopicHistory) GetClass() string {
|
||||
return ClassMessageSource
|
||||
}
|
||||
|
||||
func (*MessageSourceDirectMessagesChatTopicHistory) GetType() string {
|
||||
return TypeMessageSourceDirectMessagesChatTopicHistory
|
||||
}
|
||||
|
||||
func (*MessageSourceDirectMessagesChatTopicHistory) MessageSourceType() string {
|
||||
return TypeMessageSourceDirectMessagesChatTopicHistory
|
||||
}
|
||||
|
||||
// The message is from chat, message thread or forum topic history preview
|
||||
type MessageSourceHistoryPreview struct{
|
||||
meta
|
||||
|
|
@ -19020,6 +19157,86 @@ func (savedMessagesTopic *SavedMessagesTopic) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Contains information about a topic in a channel direct messages chat administered by the current user
|
||||
type DirectMessagesChatTopic struct {
|
||||
meta
|
||||
// Identifier of the chat to which the topic belongs
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Unique topic identifier
|
||||
Id int64 `json:"id"`
|
||||
// Identifier of the user or chat that sends the messages to the topic
|
||||
SenderId MessageSender `json:"sender_id"`
|
||||
// A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order
|
||||
Order JsonInt64 `json:"order"`
|
||||
// True, if the forum topic is marked as unread
|
||||
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
|
||||
// Number of unread messages in the chat
|
||||
UnreadCount int64 `json:"unread_count"`
|
||||
// Identifier of the last read incoming message
|
||||
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
|
||||
// Identifier of the last read outgoing message
|
||||
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
|
||||
// Number of messages with unread reactions in the chat
|
||||
UnreadReactionCount int64 `json:"unread_reaction_count"`
|
||||
// Last message in the topic; may be null if none or unknown
|
||||
LastMessage *Message `json:"last_message"`
|
||||
// A draft of a message in the topic; may be null if none
|
||||
DraftMessage *DraftMessage `json:"draft_message"`
|
||||
}
|
||||
|
||||
func (entity *DirectMessagesChatTopic) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub DirectMessagesChatTopic
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*DirectMessagesChatTopic) GetClass() string {
|
||||
return ClassDirectMessagesChatTopic
|
||||
}
|
||||
|
||||
func (*DirectMessagesChatTopic) GetType() string {
|
||||
return TypeDirectMessagesChatTopic
|
||||
}
|
||||
|
||||
func (directMessagesChatTopic *DirectMessagesChatTopic) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
ChatId int64 `json:"chat_id"`
|
||||
Id int64 `json:"id"`
|
||||
SenderId json.RawMessage `json:"sender_id"`
|
||||
Order JsonInt64 `json:"order"`
|
||||
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
|
||||
UnreadCount int64 `json:"unread_count"`
|
||||
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
|
||||
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
|
||||
UnreadReactionCount int64 `json:"unread_reaction_count"`
|
||||
LastMessage *Message `json:"last_message"`
|
||||
DraftMessage *DraftMessage `json:"draft_message"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
directMessagesChatTopic.ChatId = tmp.ChatId
|
||||
directMessagesChatTopic.Id = tmp.Id
|
||||
directMessagesChatTopic.Order = tmp.Order
|
||||
directMessagesChatTopic.IsMarkedAsUnread = tmp.IsMarkedAsUnread
|
||||
directMessagesChatTopic.UnreadCount = tmp.UnreadCount
|
||||
directMessagesChatTopic.LastReadInboxMessageId = tmp.LastReadInboxMessageId
|
||||
directMessagesChatTopic.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId
|
||||
directMessagesChatTopic.UnreadReactionCount = tmp.UnreadReactionCount
|
||||
directMessagesChatTopic.LastMessage = tmp.LastMessage
|
||||
directMessagesChatTopic.DraftMessage = tmp.DraftMessage
|
||||
|
||||
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
|
||||
directMessagesChatTopic.SenderId = fieldSenderId
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Describes a forum topic icon
|
||||
type ForumTopicIcon struct {
|
||||
meta
|
||||
|
|
@ -19050,6 +19267,8 @@ type ForumTopicInfo struct {
|
|||
meta
|
||||
// Identifier of the forum chat to which the topic belongs
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Forum topic identifier of the topic
|
||||
ForumTopicId int64 `json:"forum_topic_id"`
|
||||
// Message thread identifier of the topic
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
// Name of the topic
|
||||
|
|
@ -19089,6 +19308,7 @@ func (*ForumTopicInfo) GetType() string {
|
|||
func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
ChatId int64 `json:"chat_id"`
|
||||
ForumTopicId int64 `json:"forum_topic_id"`
|
||||
MessageThreadId int64 `json:"message_thread_id"`
|
||||
Name string `json:"name"`
|
||||
Icon *ForumTopicIcon `json:"icon"`
|
||||
|
|
@ -19106,6 +19326,7 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
|
|||
}
|
||||
|
||||
forumTopicInfo.ChatId = tmp.ChatId
|
||||
forumTopicInfo.ForumTopicId = tmp.ForumTopicId
|
||||
forumTopicInfo.MessageThreadId = tmp.MessageThreadId
|
||||
forumTopicInfo.Name = tmp.Name
|
||||
forumTopicInfo.Icon = tmp.Icon
|
||||
|
|
@ -27045,7 +27266,7 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// A message with information about a group call not bound to a chat. If the message is incoming, the call isn't active, isn't missed, and has no duration, and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden
|
||||
// A message with information about a group call not bound to a chat. If the message is incoming, the call isn't active, isn't missed, and has no duration, and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden
|
||||
type MessageGroupCall struct {
|
||||
meta
|
||||
// True, if the call is active, i.e. the called user joined the call
|
||||
|
|
@ -28441,6 +28662,8 @@ type MessageGift struct {
|
|||
Gift *Gift `json:"gift"`
|
||||
// Sender of the gift
|
||||
SenderId MessageSender `json:"sender_id"`
|
||||
// Receiver of the gift
|
||||
ReceiverId MessageSender `json:"receiver_id"`
|
||||
// Unique identifier of the received gift for the current user; only for the receiver of the gift
|
||||
ReceivedGiftId string `json:"received_gift_id"`
|
||||
// Message added to the gift
|
||||
|
|
@ -28489,6 +28712,7 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error {
|
|||
var tmp struct {
|
||||
Gift *Gift `json:"gift"`
|
||||
SenderId json.RawMessage `json:"sender_id"`
|
||||
ReceiverId json.RawMessage `json:"receiver_id"`
|
||||
ReceivedGiftId string `json:"received_gift_id"`
|
||||
Text *FormattedText `json:"text"`
|
||||
SellStarCount int64 `json:"sell_star_count"`
|
||||
|
|
@ -28523,6 +28747,9 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error {
|
|||
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
|
||||
messageGift.SenderId = fieldSenderId
|
||||
|
||||
fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId)
|
||||
messageGift.ReceiverId = fieldReceiverId
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -28533,6 +28760,8 @@ type MessageUpgradedGift struct {
|
|||
Gift *UpgradedGift `json:"gift"`
|
||||
// Sender of the gift; may be null for anonymous gifts
|
||||
SenderId MessageSender `json:"sender_id"`
|
||||
// Receiver of the gift
|
||||
ReceiverId MessageSender `json:"receiver_id"`
|
||||
// Unique identifier of the received gift for the current user; only for the receiver of the gift
|
||||
ReceivedGiftId string `json:"received_gift_id"`
|
||||
// True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred or resold gift
|
||||
|
|
@ -28579,6 +28808,7 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error
|
|||
var tmp struct {
|
||||
Gift *UpgradedGift `json:"gift"`
|
||||
SenderId json.RawMessage `json:"sender_id"`
|
||||
ReceiverId json.RawMessage `json:"receiver_id"`
|
||||
ReceivedGiftId string `json:"received_gift_id"`
|
||||
IsUpgrade bool `json:"is_upgrade"`
|
||||
IsSaved bool `json:"is_saved"`
|
||||
|
|
@ -28611,6 +28841,9 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error
|
|||
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
|
||||
messageUpgradedGift.SenderId = fieldSenderId
|
||||
|
||||
fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId)
|
||||
messageUpgradedGift.ReceiverId = fieldReceiverId
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -28621,6 +28854,8 @@ type MessageRefundedUpgradedGift struct {
|
|||
Gift *Gift `json:"gift"`
|
||||
// Sender of the gift
|
||||
SenderId MessageSender `json:"sender_id"`
|
||||
// Receiver of the gift
|
||||
ReceiverId MessageSender `json:"receiver_id"`
|
||||
// True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred or resold gift
|
||||
IsUpgrade bool `json:"is_upgrade"`
|
||||
}
|
||||
|
|
@ -28649,6 +28884,7 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da
|
|||
var tmp struct {
|
||||
Gift *Gift `json:"gift"`
|
||||
SenderId json.RawMessage `json:"sender_id"`
|
||||
ReceiverId json.RawMessage `json:"receiver_id"`
|
||||
IsUpgrade bool `json:"is_upgrade"`
|
||||
}
|
||||
|
||||
|
|
@ -28663,6 +28899,9 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da
|
|||
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
|
||||
messageRefundedUpgradedGift.SenderId = fieldSenderId
|
||||
|
||||
fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId)
|
||||
messageRefundedUpgradedGift.ReceiverId = fieldReceiverId
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -28722,6 +28961,35 @@ func (*MessagePaidMessagePriceChanged) MessageContentType() string {
|
|||
return TypeMessagePaidMessagePriceChanged
|
||||
}
|
||||
|
||||
// A price for direct messages was changed in the channel chat
|
||||
type MessageDirectMessagePriceChanged struct {
|
||||
meta
|
||||
// True, if direct messages group was enabled for the channel; false otherwise
|
||||
IsEnabled bool `json:"is_enabled"`
|
||||
// The new number of Telegram Stars that must be paid by non-administrator users of the channel chat for each message sent to the direct messages group; 0 if the direct messages group was disabled or the messages are free
|
||||
PaidMessageStarCount int64 `json:"paid_message_star_count"`
|
||||
}
|
||||
|
||||
func (entity *MessageDirectMessagePriceChanged) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub MessageDirectMessagePriceChanged
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*MessageDirectMessagePriceChanged) GetClass() string {
|
||||
return ClassMessageContent
|
||||
}
|
||||
|
||||
func (*MessageDirectMessagePriceChanged) GetType() string {
|
||||
return TypeMessageDirectMessagePriceChanged
|
||||
}
|
||||
|
||||
func (*MessageDirectMessagePriceChanged) MessageContentType() string {
|
||||
return TypeMessageDirectMessagePriceChanged
|
||||
}
|
||||
|
||||
// A contact has registered with Telegram
|
||||
type MessageContactRegistered struct{
|
||||
meta
|
||||
|
|
@ -29940,6 +30208,8 @@ func (*MessageSelfDestructTypeImmediately) MessageSelfDestructTypeType() string
|
|||
// Options to be used when a message is sent
|
||||
type MessageSendOptions struct {
|
||||
meta
|
||||
// Unique identifier of the topic in a channel direct messages chat administered by the current user; pass 0 if the chat isn't a channel direct messages chat administered by the current user
|
||||
DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"`
|
||||
// Pass true to disable notification for the message
|
||||
DisableNotification bool `json:"disable_notification"`
|
||||
// Pass true if the message is sent from the background
|
||||
|
|
@ -29952,7 +30222,7 @@ type MessageSendOptions struct {
|
|||
PaidMessageStarCount int64 `json:"paid_message_star_count"`
|
||||
// Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum
|
||||
UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"`
|
||||
// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, live location messages and self-destructing messages can't be scheduled
|
||||
// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, to a channel direct messages chat, live location messages and self-destructing messages can't be scheduled
|
||||
SchedulingState MessageSchedulingState `json:"scheduling_state"`
|
||||
// Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats
|
||||
EffectId JsonInt64 `json:"effect_id"`
|
||||
|
|
@ -29980,6 +30250,7 @@ func (*MessageSendOptions) GetType() string {
|
|||
|
||||
func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"`
|
||||
DisableNotification bool `json:"disable_notification"`
|
||||
FromBackground bool `json:"from_background"`
|
||||
ProtectContent bool `json:"protect_content"`
|
||||
|
|
@ -29997,6 +30268,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
|
|||
return err
|
||||
}
|
||||
|
||||
messageSendOptions.DirectMessagesChatTopicId = tmp.DirectMessagesChatTopicId
|
||||
messageSendOptions.DisableNotification = tmp.DisableNotification
|
||||
messageSendOptions.FromBackground = tmp.FromBackground
|
||||
messageSendOptions.ProtectContent = tmp.ProtectContent
|
||||
|
|
@ -30016,7 +30288,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
|
|||
// Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can't be copied
|
||||
type MessageCopyOptions struct {
|
||||
meta
|
||||
// True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_saved and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable
|
||||
// True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable
|
||||
SendCopy bool `json:"send_copy"`
|
||||
// True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false
|
||||
ReplaceCaption bool `json:"replace_caption"`
|
||||
|
|
@ -30858,12 +31130,12 @@ func (*InputMessageInvoice) InputMessageContentType() string {
|
|||
return TypeInputMessageInvoice
|
||||
}
|
||||
|
||||
// A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
|
||||
// A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat
|
||||
type InputMessagePoll struct {
|
||||
meta
|
||||
// Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users
|
||||
Question *FormattedText `json:"question"`
|
||||
// List of poll answer options, 2-10 strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users
|
||||
// List of poll answer options, 2-getOption("poll_answer_count_max") strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users
|
||||
Options []*FormattedText `json:"options"`
|
||||
// True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
|
||||
IsAnonymous bool `json:"is_anonymous"`
|
||||
|
|
@ -30995,6 +31267,8 @@ func (*InputMessageForwarded) InputMessageContentType() string {
|
|||
// Contains properties of a message and describes actions that can be done with the message right now
|
||||
type MessageProperties struct {
|
||||
meta
|
||||
// True, if content of the message can be copied using inputMessageForwarded or forwardMessages with copy options
|
||||
CanBeCopied bool `json:"can_be_copied"`
|
||||
// True, if content of the message can be copied to a secret chat using inputMessageForwarded or forwardMessages with copy options
|
||||
CanBeCopiedToSecretChat bool `json:"can_be_copied_to_secret_chat"`
|
||||
// True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false
|
||||
|
|
@ -31003,7 +31277,7 @@ type MessageProperties struct {
|
|||
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
|
||||
// True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message
|
||||
CanBeEdited bool `json:"can_be_edited"`
|
||||
// True, if the message can be forwarded using inputMessageForwarded or forwardMessages
|
||||
// True, if the message can be forwarded using inputMessageForwarded or forwardMessages without copy options
|
||||
CanBeForwarded bool `json:"can_be_forwarded"`
|
||||
// True, if the message can be paid using inputInvoiceMessage
|
||||
CanBePaid bool `json:"can_be_paid"`
|
||||
|
|
@ -31013,7 +31287,7 @@ type MessageProperties struct {
|
|||
CanBeReplied bool `json:"can_be_replied"`
|
||||
// True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage
|
||||
CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"`
|
||||
// True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options
|
||||
// True, if content of the message can be saved locally
|
||||
CanBeSaved bool `json:"can_be_saved"`
|
||||
// True, if the message can be shared in a story using inputStoryAreaTypeMessage
|
||||
CanBeSharedInStory bool `json:"can_be_shared_in_story"`
|
||||
|
|
@ -31021,6 +31295,8 @@ type MessageProperties struct {
|
|||
CanEditMedia bool `json:"can_edit_media"`
|
||||
// True, if scheduling state of the message can be edited
|
||||
CanEditSchedulingState bool `json:"can_edit_scheduling_state"`
|
||||
// True, if author of the message sent on behalf of a chat can be received through getMessageAuthor
|
||||
CanGetAuthor bool `json:"can_get_author"`
|
||||
// True, if code for message embedding can be received using getMessageEmbeddingCode
|
||||
CanGetEmbeddingCode bool `json:"can_get_embedding_code"`
|
||||
// True, if a link can be generated for the message using getMessageLink
|
||||
|
|
@ -34981,7 +35257,7 @@ func (*ResendCodeReasonUserRequest) ResendCodeReasonType() string {
|
|||
// The code is re-sent, because device verification has failed
|
||||
type ResendCodeReasonVerificationFailed struct {
|
||||
meta
|
||||
// Cause of the verification failure, for example, PLAY_SERVICES_NOT_AVAILABLE, APNS_RECEIVE_TIMEOUT, or APNS_INIT_FAILED
|
||||
// Cause of the verification failure, for example, "PLAY_SERVICES_NOT_AVAILABLE", "APNS_RECEIVE_TIMEOUT", or "APNS_INIT_FAILED"
|
||||
ErrorMessage string `json:"error_message"`
|
||||
}
|
||||
|
||||
|
|
@ -49650,7 +49926,7 @@ func (*InternalLinkTypeGame) InternalLinkTypeType() string {
|
|||
return TypeInternalLinkTypeGame
|
||||
}
|
||||
|
||||
// The link is a link to a group call that isn't bound to a chat. Call joinGroupCall with the given invite_link
|
||||
// The link is a link to a group call that isn't bound to a chat. Use getGroupCallParticipants to get the list of group call participants and show them on the join group call screen. Call joinGroupCall with the given invite_link to join the call
|
||||
type InternalLinkTypeGroupCall struct {
|
||||
meta
|
||||
// Internal representation of the invite link
|
||||
|
|
@ -54541,7 +54817,7 @@ func (*VectorPathCommandLine) VectorPathCommandType() string {
|
|||
return TypeVectorPathCommandLine
|
||||
}
|
||||
|
||||
// A cubic Bézier curve to a given point
|
||||
// A cubic Bézier curve to a given point
|
||||
type VectorPathCommandCubicBezierCurve struct {
|
||||
meta
|
||||
// The start control point of the curve
|
||||
|
|
@ -56538,6 +56814,85 @@ func (*UpdateSavedMessagesTopicCount) UpdateType() string {
|
|||
return TypeUpdateSavedMessagesTopicCount
|
||||
}
|
||||
|
||||
// Basic information about a topic in a channel direct messages chat administered by the current user has changed. This update is guaranteed to come before the topic identifier is returned to the application
|
||||
type UpdateDirectMessagesChatTopic struct {
|
||||
meta
|
||||
// New data about the topic
|
||||
Topic *DirectMessagesChatTopic `json:"topic"`
|
||||
}
|
||||
|
||||
func (entity *UpdateDirectMessagesChatTopic) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateDirectMessagesChatTopic
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateDirectMessagesChatTopic) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateDirectMessagesChatTopic) GetType() string {
|
||||
return TypeUpdateDirectMessagesChatTopic
|
||||
}
|
||||
|
||||
func (*UpdateDirectMessagesChatTopic) UpdateType() string {
|
||||
return TypeUpdateDirectMessagesChatTopic
|
||||
}
|
||||
|
||||
// Number of messages in a topic has changed; for Saved Messages and channel direct messages chat topics only
|
||||
type UpdateTopicMessageCount struct {
|
||||
meta
|
||||
// Identifier of the chat in topic of which the number of messages has changed
|
||||
ChatId int64 `json:"chat_id"`
|
||||
// Identifier of the topic
|
||||
TopicId MessageTopic `json:"topic_id"`
|
||||
// Approximate number of messages in the topics
|
||||
MessageCount int32 `json:"message_count"`
|
||||
}
|
||||
|
||||
func (entity *UpdateTopicMessageCount) MarshalJSON() ([]byte, error) {
|
||||
entity.meta.Type = entity.GetType()
|
||||
|
||||
type stub UpdateTopicMessageCount
|
||||
|
||||
return json.Marshal((*stub)(entity))
|
||||
}
|
||||
|
||||
func (*UpdateTopicMessageCount) GetClass() string {
|
||||
return ClassUpdate
|
||||
}
|
||||
|
||||
func (*UpdateTopicMessageCount) GetType() string {
|
||||
return TypeUpdateTopicMessageCount
|
||||
}
|
||||
|
||||
func (*UpdateTopicMessageCount) UpdateType() string {
|
||||
return TypeUpdateTopicMessageCount
|
||||
}
|
||||
|
||||
func (updateTopicMessageCount *UpdateTopicMessageCount) UnmarshalJSON(data []byte) error {
|
||||
var tmp struct {
|
||||
ChatId int64 `json:"chat_id"`
|
||||
TopicId json.RawMessage `json:"topic_id"`
|
||||
MessageCount int32 `json:"message_count"`
|
||||
}
|
||||
|
||||
err := json.Unmarshal(data, &tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
updateTopicMessageCount.ChatId = tmp.ChatId
|
||||
updateTopicMessageCount.MessageCount = tmp.MessageCount
|
||||
|
||||
fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId)
|
||||
updateTopicMessageCount.TopicId = fieldTopicId
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application
|
||||
type UpdateQuickReplyShortcut struct {
|
||||
meta
|
||||
|
|
@ -56688,6 +57043,10 @@ type UpdateForumTopic struct {
|
|||
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
|
||||
// Identifier of the last read outgoing message
|
||||
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
|
||||
// Number of unread messages with a mention/reply in the topic
|
||||
UnreadMentionCount int32 `json:"unread_mention_count"`
|
||||
// Number of messages with unread reactions in the topic
|
||||
UnreadReactionCount int32 `json:"unread_reaction_count"`
|
||||
// Notification settings for the topic
|
||||
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1599,6 +1599,43 @@ func UnmarshalListOfPaidReactionType(dataList []json.RawMessage) ([]PaidReaction
|
|||
return list, nil
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopic(data json.RawMessage) (MessageTopic, error) {
|
||||
var meta meta
|
||||
|
||||
err := json.Unmarshal(data, &meta)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch meta.Type {
|
||||
case TypeMessageTopicForum:
|
||||
return UnmarshalMessageTopicForum(data)
|
||||
|
||||
case TypeMessageTopicDirectMessages:
|
||||
return UnmarshalMessageTopicDirectMessages(data)
|
||||
|
||||
case TypeMessageTopicSavedMessages:
|
||||
return UnmarshalMessageTopicSavedMessages(data)
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
|
||||
}
|
||||
}
|
||||
|
||||
func UnmarshalListOfMessageTopic(dataList []json.RawMessage) ([]MessageTopic, error) {
|
||||
list := []MessageTopic{}
|
||||
|
||||
for _, data := range dataList {
|
||||
entity, err := UnmarshalMessageTopic(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list = append(list, entity)
|
||||
}
|
||||
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func UnmarshalMessageEffectType(data json.RawMessage) (MessageEffectType, error) {
|
||||
var meta meta
|
||||
|
||||
|
|
@ -1756,6 +1793,9 @@ func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) {
|
|||
case TypeMessageSourceForumTopicHistory:
|
||||
return UnmarshalMessageSourceForumTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceDirectMessagesChatTopicHistory:
|
||||
return UnmarshalMessageSourceDirectMessagesChatTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceHistoryPreview:
|
||||
return UnmarshalMessageSourceHistoryPreview(data)
|
||||
|
||||
|
|
@ -3608,6 +3648,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
|
|||
case TypeMessagePaidMessagePriceChanged:
|
||||
return UnmarshalMessagePaidMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageDirectMessagePriceChanged:
|
||||
return UnmarshalMessageDirectMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageContactRegistered:
|
||||
return UnmarshalMessageContactRegistered(data)
|
||||
|
||||
|
|
@ -8393,6 +8436,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
||||
|
||||
case TypeUpdateDirectMessagesChatTopic:
|
||||
return UnmarshalUpdateDirectMessagesChatTopic(data)
|
||||
|
||||
case TypeUpdateTopicMessageCount:
|
||||
return UnmarshalUpdateTopicMessageCount(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(data)
|
||||
|
||||
|
|
@ -11484,6 +11533,30 @@ func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopicForum(data json.RawMessage) (*MessageTopicForum, error) {
|
||||
var resp MessageTopicForum
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopicDirectMessages(data json.RawMessage) (*MessageTopicDirectMessages, error) {
|
||||
var resp MessageTopicDirectMessages
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopicSavedMessages(data json.RawMessage) (*MessageTopicSavedMessages, error) {
|
||||
var resp MessageTopicSavedMessages
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageEffectTypeEmojiReaction(data json.RawMessage) (*MessageEffectTypeEmojiReaction, error) {
|
||||
var resp MessageEffectTypeEmojiReaction
|
||||
|
||||
|
|
@ -11692,6 +11765,14 @@ func UnmarshalMessageSourceForumTopicHistory(data json.RawMessage) (*MessageSour
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageSourceDirectMessagesChatTopicHistory(data json.RawMessage) (*MessageSourceDirectMessagesChatTopicHistory, error) {
|
||||
var resp MessageSourceDirectMessagesChatTopicHistory
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageSourceHistoryPreview(data json.RawMessage) (*MessageSourceHistoryPreview, error) {
|
||||
var resp MessageSourceHistoryPreview
|
||||
|
||||
|
|
@ -12572,6 +12653,14 @@ func UnmarshalSavedMessagesTopic(data json.RawMessage) (*SavedMessagesTopic, err
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalDirectMessagesChatTopic(data json.RawMessage) (*DirectMessagesChatTopic, error) {
|
||||
var resp DirectMessagesChatTopic
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) {
|
||||
var resp ForumTopicIcon
|
||||
|
||||
|
|
@ -14836,6 +14925,14 @@ func UnmarshalMessagePaidMessagePriceChanged(data json.RawMessage) (*MessagePaid
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageDirectMessagePriceChanged(data json.RawMessage) (*MessageDirectMessagePriceChanged, error) {
|
||||
var resp MessageDirectMessagePriceChanged
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) {
|
||||
var resp MessageContactRegistered
|
||||
|
||||
|
|
@ -21948,6 +22045,22 @@ func UnmarshalUpdateSavedMessagesTopicCount(data json.RawMessage) (*UpdateSavedM
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateDirectMessagesChatTopic(data json.RawMessage) (*UpdateDirectMessagesChatTopic, error) {
|
||||
var resp UpdateDirectMessagesChatTopic
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateTopicMessageCount(data json.RawMessage) (*UpdateTopicMessageCount, error) {
|
||||
var resp UpdateTopicMessageCount
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateQuickReplyShortcut(data json.RawMessage) (*UpdateQuickReplyShortcut, error) {
|
||||
var resp UpdateQuickReplyShortcut
|
||||
|
||||
|
|
@ -23929,6 +24042,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeUnreadReaction:
|
||||
return UnmarshalUnreadReaction(data)
|
||||
|
||||
case TypeMessageTopicForum:
|
||||
return UnmarshalMessageTopicForum(data)
|
||||
|
||||
case TypeMessageTopicDirectMessages:
|
||||
return UnmarshalMessageTopicDirectMessages(data)
|
||||
|
||||
case TypeMessageTopicSavedMessages:
|
||||
return UnmarshalMessageTopicSavedMessages(data)
|
||||
|
||||
case TypeMessageEffectTypeEmojiReaction:
|
||||
return UnmarshalMessageEffectTypeEmojiReaction(data)
|
||||
|
||||
|
|
@ -24007,6 +24129,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeMessageSourceForumTopicHistory:
|
||||
return UnmarshalMessageSourceForumTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceDirectMessagesChatTopicHistory:
|
||||
return UnmarshalMessageSourceDirectMessagesChatTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceHistoryPreview:
|
||||
return UnmarshalMessageSourceHistoryPreview(data)
|
||||
|
||||
|
|
@ -24337,6 +24462,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeSavedMessagesTopic:
|
||||
return UnmarshalSavedMessagesTopic(data)
|
||||
|
||||
case TypeDirectMessagesChatTopic:
|
||||
return UnmarshalDirectMessagesChatTopic(data)
|
||||
|
||||
case TypeForumTopicIcon:
|
||||
return UnmarshalForumTopicIcon(data)
|
||||
|
||||
|
|
@ -25186,6 +25314,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeMessagePaidMessagePriceChanged:
|
||||
return UnmarshalMessagePaidMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageDirectMessagePriceChanged:
|
||||
return UnmarshalMessageDirectMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageContactRegistered:
|
||||
return UnmarshalMessageContactRegistered(data)
|
||||
|
||||
|
|
@ -27853,6 +27984,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
||||
|
||||
case TypeUpdateDirectMessagesChatTopic:
|
||||
return UnmarshalUpdateDirectMessagesChatTopic(data)
|
||||
|
||||
case TypeUpdateTopicMessageCount:
|
||||
return UnmarshalUpdateTopicMessageCount(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue