github.com/tada-team/tdproto@v1.51.57/server_chat_updated.go (about)

     1  package tdproto
     2  
     3  func NewServerChatUpdated(chat Chat, teamUnread *TeamUnread, badge uint) (r ServerChatUpdated) {
     4  	return NewServerChatsUpdated([]Chat{chat}, teamUnread, badge)
     5  }
     6  
     7  func NewServerChatsUpdated(chats []Chat, teamUnread *TeamUnread, badge uint) (r ServerChatUpdated) {
     8  	r.Name = r.GetName()
     9  	r.Params.Chats = chats
    10  	r.Params.TeamUnread = teamUnread
    11  	r.Params.Badge = badge
    12  	return r
    13  }
    14  
    15  // Chat created or updated
    16  type ServerChatUpdated struct {
    17  	BaseEvent
    18  	Params serverChatUpdatedParams `json:"params"`
    19  }
    20  
    21  func (p ServerChatUpdated) GetName() string { return "server.chat.updated" }
    22  
    23  // Params of the server.chat.updated event
    24  type serverChatUpdatedParams struct {
    25  	// Chat counters
    26  	Chats []Chat `json:"chats"`
    27  
    28  	// Current team counters
    29  	TeamUnread *TeamUnread `json:"team_unread"`
    30  
    31  	// Total number of unreads
    32  	Badge uint `json:"badge"`
    33  }