Improve debug logging of Telegram updates

calls
bodqhrohro 4 years ago
parent 354a4acd19
commit 5b82d5d718

@ -48,30 +48,35 @@ func (c *Client) updateHandler() {
uhOh()
}
c.updateUser(typedUpdate)
log.Debugf("%#v", typedUpdate.User)
case client.TypeUpdateUserStatus:
typedUpdate, ok := update.(*client.UpdateUserStatus)
if !ok {
uhOh()
}
c.updateUserStatus(typedUpdate)
log.Debugf("%#v", typedUpdate.Status)
case client.TypeUpdateNewChat:
typedUpdate, ok := update.(*client.UpdateNewChat)
if !ok {
uhOh()
}
c.updateNewChat(typedUpdate)
log.Debugf("%#v", typedUpdate.Chat)
case client.TypeUpdateNewMessage:
typedUpdate, ok := update.(*client.UpdateNewMessage)
if !ok {
uhOh()
}
c.updateNewMessage(typedUpdate)
log.Debugf("%#v", typedUpdate.Message)
case client.TypeUpdateMessageContent:
typedUpdate, ok := update.(*client.UpdateMessageContent)
if !ok {
uhOh()
}
c.updateMessageContent(typedUpdate)
log.Debugf("%#v", typedUpdate.NewContent)
case client.TypeUpdateDeleteMessages:
typedUpdate, ok := update.(*client.UpdateDeleteMessages)
if !ok {
@ -84,6 +89,7 @@ func (c *Client) updateHandler() {
uhOh()
}
c.updateFile(typedUpdate)
log.Debugf("%#v", typedUpdate.File)
default:
// log only handled types
continue

Loading…
Cancel
Save