This commit is contained in:
shoopea 2020-02-05 12:52:11 +08:00
parent 63adca3553
commit 1757e927f1

View File

@ -19,7 +19,7 @@ func logOnError(err error, msg string) {
} }
} }
func unmarshalCallbackQueryPayload(rawMsg *json.RawMessage) (tdlib.CallbackQueryPayload, error) { func unmarshalCallbackQueryPayload(rawMsg []byte) (tdlib.CallbackQueryPayload, error) {
if rawMsg == nil { if rawMsg == nil {
return nil, nil return nil, nil
@ -32,12 +32,12 @@ func unmarshalCallbackQueryPayload(rawMsg *json.RawMessage) (tdlib.CallbackQuery
switch tdlib.CallbackQueryPayloadEnum(objMap["@type"].(string)) { switch tdlib.CallbackQueryPayloadEnum(objMap["@type"].(string)) {
case tdlib.CallbackQueryPayloadDataType: case tdlib.CallbackQueryPayloadDataType:
var callbackQueryPayloadData CallbackQueryPayloadData var callbackQueryPayloadData tdlib.CallbackQueryPayloadData
err := json.Unmarshal(*rawMsg, &callbackQueryPayloadData) err := json.Unmarshal(*rawMsg, &callbackQueryPayloadData)
return &callbackQueryPayloadData, err return &callbackQueryPayloadData, err
case tdlib.CallbackQueryPayloadGameType: case tdlib.CallbackQueryPayloadGameType:
var callbackQueryPayloadGame CallbackQueryPayloadGame var callbackQueryPayloadGame tdlib.CallbackQueryPayloadGame
err := json.Unmarshal(*rawMsg, &callbackQueryPayloadGame) err := json.Unmarshal(*rawMsg, &callbackQueryPayloadGame)
return &callbackQueryPayloadGame, err return &callbackQueryPayloadGame, err