From 5b82d5d718eea29b24eb58b66d1488ed21e13500 Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Wed, 4 Dec 2019 18:22:22 +0200 Subject: [PATCH] Improve debug logging of Telegram updates --- telegram/handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/telegram/handlers.go b/telegram/handlers.go index 5c421bb..0b76b48 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -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