Merge pull request #43 from rubenlagus/dev
Support editing messagess sent "via bot" upon editing
This commit is contained in:
commit
56a0cf985e
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.telegram.telegrambots.Constants;
|
||||
import org.telegram.telegrambots.api.methods.BotApiMethod;
|
||||
@ -119,7 +120,11 @@ public class EditMessageCaption extends BotApiMethod<Message> {
|
||||
@Override
|
||||
public Message deserializeResponse(JSONObject answer) {
|
||||
if (answer.getBoolean(Constants.RESPONSEFIELDOK)) {
|
||||
try {
|
||||
return new Message(answer.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
} catch (JSONException e) {
|
||||
return new Message();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.telegram.telegrambots.Constants;
|
||||
import org.telegram.telegrambots.api.methods.BotApiMethod;
|
||||
@ -105,7 +106,11 @@ public class EditMessageReplyMarkup extends BotApiMethod<Message> {
|
||||
@Override
|
||||
public Message deserializeResponse(JSONObject answer) {
|
||||
if (answer.getBoolean(Constants.RESPONSEFIELDOK)) {
|
||||
try {
|
||||
return new Message(answer.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
} catch (JSONException e) {
|
||||
return new Message();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.telegram.telegrambots.Constants;
|
||||
import org.telegram.telegrambots.api.methods.BotApiMethod;
|
||||
@ -163,7 +164,11 @@ public class EditMessageText extends BotApiMethod<Message> {
|
||||
@Override
|
||||
public Message deserializeResponse(JSONObject answer) {
|
||||
if (answer.getBoolean(Constants.RESPONSEFIELDOK)) {
|
||||
try {
|
||||
return new Message(answer.getJSONObject(Constants.RESPONSEFIELDRESULT));
|
||||
} catch (JSONException e) {
|
||||
return new Message();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user