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

     1  package tdproto
     2  
     3  func NewServerChatComposing(composing, isAudio bool, chat, actor JID) (r ServerChatComposing) {
     4  	r.Name = r.GetName()
     5  	r.Params.Jid = chat
     6  	r.Params.Actor = actor
     7  	r.Params.Composing = composing
     8  	r.Params.IsAudio = isAudio
     9  	return r
    10  }
    11  
    12  // Someone typing or recording audiomessage in chat
    13  type ServerChatComposing struct {
    14  	BaseEvent
    15  	Params serverChatComposingParams `json:"params"`
    16  }
    17  
    18  func (p ServerChatComposing) GetName() string { return "server.chat.composing" }
    19  
    20  // Params of the server.chat.composing event
    21  type serverChatComposingParams struct {
    22  	// Chat or contact id
    23  	Jid JID `json:"jid"`
    24  
    25  	// Actor id
    26  	Actor JID `json:"actor"`
    27  
    28  	// true = start typing / audio recording, false = stop
    29  	Composing bool `json:"composing"`
    30  
    31  	// true = audiomessage, false = text typing
    32  	IsAudio bool `json:"is_audio,omitempty"`
    33  
    34  	// Composing event max lifetime
    35  	ValidUntil ISODateTimeString `json:"valid_until,omitempty"`
    36  }