pro.zackpollard.telegrambot.api.internal.updates.UpdateImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtelegram-botapi Show documentation
Show all versions of jtelegram-botapi Show documentation
The Java Telegram Bot API is a wrapper for the Telegram HTTP Bot API
package pro.zackpollard.telegrambot.api.internal.updates;
import org.json.JSONObject;
import pro.zackpollard.telegrambot.api.chat.message.Message;
import pro.zackpollard.telegrambot.api.internal.chat.message.MessageImpl;
import pro.zackpollard.telegrambot.api.updates.Update;
/**
* @author Zack Pollard
*/
public class UpdateImpl implements Update {
private final int update_id;
private final Message message;
private UpdateImpl(JSONObject jsonObject) {
this.update_id = jsonObject.getInt("update_id");
this.message = MessageImpl.createMessage(jsonObject.getJSONObject("message"));
}
public static Update createUpdate(JSONObject jsonObject) {
return new UpdateImpl(jsonObject);
}
@Override
public int getId() {
return update_id;
}
@Override
public Message getMessage() {
return message;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy