editCaption with KB

This commit is contained in:
MrBesen 2019-02-11 17:39:59 +01:00
parent 077017f590
commit 8b67f1d8a2
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import de.mrbesen.telegram.log.SimpleLog;
import de.mrbesen.telegram.objects.JSONBased.Member;
import de.mrbesen.telegram.objects.TAudio;
import de.mrbesen.telegram.objects.TMessage;
import de.mrbesen.telegram.objects.TReplyMarkup;
import de.mrbesen.telegram.objects.TUser;
import de.mrbesen.telegram.objects.TUser.Status;
@ -178,9 +179,12 @@ public class TelegramAPI implements Runnable {
}).start();
}
public void updateCaption(final String newCaption, int chatid, int msg_id, boolean async, Callback<JSONObject, ?> clb) {
public void updateCaption(final String newCaption, int chatid, int msg_id, TReplyMarkup rm, boolean async, Callback<JSONObject, ?> clb) {
try {
String q = "chat_id=" + chatid + "&message_id=" + msg_id + "&caption=" + URLEncoder.encode(newCaption, "UTF-8");
String rply = "";
if(rm != null)
rply = "&reply_markup=" + URLEncoder.encode(rm.toJSONString(), "UTF-8");
String q = "chat_id=" + chatid + "&message_id=" + msg_id + "&caption=" + URLEncoder.encode(newCaption, "UTF-8") + rply;
if(async) {
this.async.enque("editMessageCaption", q);
} else {