Fix response processing on methods: sendDocument sendPhoto sendVideo sendSticker sendVoice
This commit is contained in:
parent
0d86836e14
commit
4f427ba5d8
@ -435,7 +435,7 @@ public abstract class AbsSender {
|
||||
throw new TelegramApiException("Error at sendDocument", jsonObject.getString("description"));
|
||||
}
|
||||
|
||||
return new Message(jsonObject);
|
||||
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
}
|
||||
|
||||
public Message sendPhoto(SendPhoto sendPhoto) throws TelegramApiException {
|
||||
@ -494,7 +494,7 @@ public abstract class AbsSender {
|
||||
throw new TelegramApiException("Error at sendPhoto", jsonObject.getString("description"));
|
||||
}
|
||||
|
||||
return new Message(jsonObject);
|
||||
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
}
|
||||
|
||||
public Message sendVideo(SendVideo sendVideo) throws TelegramApiException {
|
||||
@ -571,7 +571,7 @@ public abstract class AbsSender {
|
||||
throw new TelegramApiException("Error at sendVideo", jsonObject.getString("description"));
|
||||
}
|
||||
|
||||
return new Message(jsonObject);
|
||||
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
}
|
||||
|
||||
public Message sendSticker(SendSticker sendSticker) throws TelegramApiException {
|
||||
@ -625,7 +625,7 @@ public abstract class AbsSender {
|
||||
throw new TelegramApiException("Error at sendSticker", jsonObject.getString("description"));
|
||||
}
|
||||
|
||||
return new Message(jsonObject);
|
||||
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -775,7 +775,7 @@ public abstract class AbsSender {
|
||||
throw new TelegramApiException("Error at sendVoice", jsonObject.getString("description"));
|
||||
}
|
||||
|
||||
return new Message(jsonObject);
|
||||
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
}
|
||||
|
||||
// Simplified methods
|
||||
|
Loading…
Reference in New Issue
Block a user