From ac18b952b9704335f87e376448713a2e70ac81ef Mon Sep 17 00:00:00 2001 From: Marcel Caspar Date: Sun, 20 Mar 2016 13:06:34 +0100 Subject: [PATCH] change if clause in AbsSender.sendAudio() that checks if the response contains a positive 'ok' --- src/main/java/org/telegram/telegrambots/bots/AbsSender.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/telegram/telegrambots/bots/AbsSender.java b/src/main/java/org/telegram/telegrambots/bots/AbsSender.java index aeb43235..44500d18 100644 --- a/src/main/java/org/telegram/telegrambots/bots/AbsSender.java +++ b/src/main/java/org/telegram/telegrambots/bots/AbsSender.java @@ -520,7 +520,8 @@ public abstract class AbsSender { JSONObject jsonObject = new JSONObject(responseContent); - if(jsonObject.has("result")){ + //if we got an ok, then we can expect a "reseult" section. and out of this can a new Message object be built + if(jsonObject.has("ok") && jsonObject.getBoolean("ok")){ return new Message(jsonObject.getJSONObject("result")); }