MessageBuilder.send()
This commit is contained in:
parent
4429763547
commit
589fd898f2
|
@ -25,7 +25,14 @@ public class MessageBuilder {
|
||||||
private String attachment = null;
|
private String attachment = null;
|
||||||
private String caption = null;
|
private String caption = null;
|
||||||
private int updates = 0;
|
private int updates = 0;
|
||||||
|
private TelegramAPI api = null;
|
||||||
|
|
||||||
|
public MessageBuilder(TelegramAPI api) {
|
||||||
|
this.api = api;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessageBuilder() { }
|
||||||
|
|
||||||
public MessageBuilder setReciver(long id) {
|
public MessageBuilder setReciver(long id) {
|
||||||
reciver_id = id;
|
reciver_id = id;
|
||||||
return this;
|
return this;
|
||||||
|
@ -198,6 +205,14 @@ public class MessageBuilder {
|
||||||
}
|
}
|
||||||
return new SendableMessage(cmd, q);
|
return new SendableMessage(cmd, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* is only allowed, when the Message builder was contructed using a api
|
||||||
|
* @return the send TMessage when the Message Builder is used SYNC, or null when the Message Builder is used ASYNC or has encountered an error.
|
||||||
|
*/
|
||||||
|
public TMessage send() {
|
||||||
|
return api.sendMessage(build());
|
||||||
|
}
|
||||||
|
|
||||||
class SendableMessage {
|
class SendableMessage {
|
||||||
private String q;
|
private String q;
|
||||||
|
|
Loading…
Reference in New Issue