This commit is contained in:
shoopea 2020-02-05 12:47:08 +08:00
parent 40b5f870dc
commit 86fec4550c

14
td.go
View File

@ -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)
}