aboutsummaryrefslogtreecommitdiff
path: root/telegram/handlers.go
diff options
context:
space:
mode:
authorbodqhrohro <bodqhrohro@gmail.com>2019-12-04 19:22:22 +0300
committerbodqhrohro <bodqhrohro@gmail.com>2019-12-04 19:22:22 +0300
commit5b82d5d718eea29b24eb58b66d1488ed21e13500 (patch)
tree0885165fc122833f5b70c5609a6e73a739bc741a /telegram/handlers.go
parent354a4acd19d5376477275588d3e170df6a688697 (diff)
Improve debug logging of Telegram updates
Diffstat (limited to 'telegram/handlers.go')
-rw-r--r--telegram/handlers.go6
1 files changed, 6 insertions, 0 deletions
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