From 86fec4550cf3d4aeba7725a9a81265d5f12cc1ff Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 5 Feb 2020 12:47:08 +0800 Subject: [PATCH] test --- td.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/td.go b/td.go index 40fdf7f..0e4fdc7 100644 --- a/td.go +++ b/td.go @@ -296,16 +296,16 @@ func clientMsg(c *tdlib.Client, m TGCommand) { MQCWMsgQueue <- r } case commandCallback: - p := tdlib.NewCallbackQueryPayloadData(m.CallbackData) + d := tdlib.NewCallbackQueryPayloadData(m.CallbackData) b, _ := json.Marshal(p) log.Printf("CallbackQueryPayloadData :\n%s\n", string(b)) log.Printf("Type : %s\n", p.GetCallbackQueryPayloadEnum()) - /* - a, err := c.GetCallbackQueryAnswer(m.FromChatID64, m.FromMsgID64, p) - logOnError(err, "clientMsg : GetCallbackQueryAnswer") - b, _ := json.Marshal(a) - log.Printf("GetCallbackQueryAnswer :\n%s\n", string(b)) - */ + p, err := tdlib.unmarshalCallbackQueryPayload(b) + + a, err := c.GetCallbackQueryAnswer(m.FromChatID64, m.FromMsgID64, p) + logOnError(err, "clientMsg : GetCallbackQueryAnswer") + b, _ = json.Marshal(a) + log.Printf("GetCallbackQueryAnswer :\n%s\n", string(b)) default: log.Printf("clientMsg : No handler for command %d.\n", m.Type) }