update captions
This commit is contained in:
parent
d52e8f22a4
commit
077017f590
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
@ -177,6 +178,19 @@ public class TelegramAPI implements Runnable {
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateCaption(final String newCaption, int chatid, int msg_id, boolean async, Callback<JSONObject, ?> clb) {
|
||||||
|
try {
|
||||||
|
String q = "chat_id=" + chatid + "&message_id=" + msg_id + "&caption=" + URLEncoder.encode(newCaption, "UTF-8");
|
||||||
|
if(async) {
|
||||||
|
this.async.enque("editMessageCaption", q);
|
||||||
|
} else {
|
||||||
|
request("editMessageCaption", q);
|
||||||
|
}
|
||||||
|
} catch(IOException e) {
|
||||||
|
log.log("", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
run = false;
|
run = false;
|
||||||
thread.interrupt();
|
thread.interrupt();
|
||||||
|
|
Loading…
Reference in New Issue