added begin, end typing functions.

This commit is contained in:
5elenay 2022-01-28 22:06:20 +03:00
parent 3b6caba1dd
commit 738bf5caf5

View File

@ -220,3 +220,13 @@ func (c Channel) DeleteGroupRecipient(user_id string) error {
_, err := c.Client.Request("DELETE", "/channels/"+c.Id+"/recipients/"+user_id, []byte{})
return err
}
// Send a typing start event to the channel.
func (c *Channel) BeginTyping() {
c.Client.Socket.SendText(fmt.Sprintf("{\"type\":\"BeginTyping\",\"channel\":\"%s\"}", c.Id))
}
// End the typing event in the channel.
func (c *Channel) EndTyping() {
c.Client.Socket.SendText(fmt.Sprintf("{\"type\":\"EndTyping\",\"channel\":\"%s\"}", c.Id))
}