Skip to content
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.idea
.vs
.settings
library/bin/*

*.iml
*.class
.gradle
build
out
Expand All @@ -8,3 +13,6 @@ target
.DS_Store
local.properties
private.key
.project
library/.classpath
sample/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Contact implements Serializable {
private String phone_number;
private String first_name;
private String last_name;
private Integer user_id;
private Long user_id;
private String vcard;

public String phoneNumber() {
Expand All @@ -27,7 +27,7 @@ public String lastName() {
return last_name;
}

public Integer userId() {
public Long userId() {
return user_id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class InlineQuery implements Serializable {
private Location location;
private String query;
private String offset;
private String chat_type;

public String id() {
return id;
Expand All @@ -35,6 +36,10 @@ public String offset() {
return offset;
}

public String chatType() {
return chat_type;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -46,8 +51,9 @@ public boolean equals(Object o) {
if (from != null ? !from.equals(that.from) : that.from != null) return false;
if (location != null ? !location.equals(that.location) : that.location != null) return false;
if (query != null ? !query.equals(that.query) : that.query != null) return false;
return offset != null ? offset.equals(that.offset) : that.offset == null;
if (chat_type != null ? !chat_type.equals(that.chat_type) : that.chat_type != null) return false;

return offset != null ? offset.equals(that.offset) : that.offset == null;
}

@Override
Expand All @@ -63,6 +69,7 @@ public String toString() {
", location=" + location +
", query='" + query + '\'' +
", offset='" + offset + '\'' +
", chat_type='" + chat_type + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public class Message implements Serializable {
private VoiceChatStarted voice_chat_started;
private VoiceChatEnded voice_chat_ended;
private VoiceChatParticipantsInvited voice_chat_participants_invited;
private VoiceChatScheduled voice_chat_scheduled;
private InlineKeyboardMarkup reply_markup;

public Integer messageId() {
Expand Down Expand Up @@ -286,6 +287,10 @@ public VoiceChatParticipantsInvited voiceChatParticipantsInvited() {
return voice_chat_participants_invited;
}

public VoiceChatScheduled voiceChatScheduled() {
return voice_chat_scheduled;
}

public InlineKeyboardMarkup replyMarkup() {
return reply_markup;
}
Expand Down Expand Up @@ -349,6 +354,7 @@ public boolean equals(Object o) {
Objects.equals(voice_chat_started, message.voice_chat_started) &&
Objects.equals(voice_chat_ended, message.voice_chat_ended) &&
Objects.equals(voice_chat_participants_invited, message.voice_chat_participants_invited) &&
Objects.equals(voice_chat_scheduled, message.voice_chat_scheduled) &&
Objects.equals(reply_markup, message.reply_markup);
}

Expand Down Expand Up @@ -414,6 +420,7 @@ public String toString() {
", voice_chat_started=" + voice_chat_started +
", voice_chat_ended=" + voice_chat_ended +
", voice_chat_participants_invited=" + voice_chat_participants_invited +
", voice_chat_scheduled=" + voice_chat_scheduled +
", reply_markup=" + reply_markup +
'}';
}
Expand Down
6 changes: 3 additions & 3 deletions library/src/main/java/com/pengrad/telegrambot/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class User implements Serializable {
private final static long serialVersionUID = 0L;

private Integer id;
private Long id;
private Boolean is_bot;
private String first_name;
private String last_name;
Expand All @@ -22,11 +22,11 @@ public class User implements Serializable {
private User() {
}

public User(Integer id) {
public User(Long id) {
this.id = id;
}

public Integer id() {
public Long id() {
return id;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.pengrad.telegrambot.model;

import java.io.Serializable;

public class VoiceChatScheduled implements Serializable {

private final static long serialVersionUID = 0L;

private Integer start_date;

public Integer startDate() {
return start_date;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;

return o != null && getClass() == o.getClass();
}

@Override
public int hashCode() {
return 1;
}

@Override
public String toString() {
return "VoiceChatScheduled{" +
"start_date=" + start_date +
'}';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* 10/21/15.
*/
public enum ChatAction {
typing, upload_photo, record_video, upload_video, record_audio, upload_audio, upload_document, find_location,
typing, upload_photo, record_video, upload_video, record_voice, upload_voice, upload_document, find_location,
record_video_note, upload_video_note
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package com.pengrad.telegrambot.model.request;

import java.io.Serializable;

public class InputInvoiceMessageContent extends InputMessageContent implements Serializable {

private final static long serialVersionUID = 0L;

private String title;
private String description;

private String payload;
private String provider_token;

private String currency;
private LabeledPrice[] prices;

private Integer max_tip_amount;
private Integer[] suggested_tip_amount;

private String provider_data;

private String photo_url;
private Integer photo_size;
private Integer photo_width;
private Integer photo_height;

private boolean need_name;
private boolean need_phone_number;
private boolean need_email;
private boolean need_shipping_address;
private boolean send_phone_number_to_provider;
private boolean send_email_to_provider;

private boolean is_flexible;


public InputInvoiceMessageContent(String title, String description, String payload, String providerToken, String currency, LabeledPrice[] prices) {
this.title = title;
this.description = description;
this.payload = payload;
this.provider_token = providerToken;
this.currency = currency;
this.prices = prices;
}

public InputInvoiceMessageContent maxTipAmount(Integer maxTipAmount) {
this.max_tip_amount = maxTipAmount;
return this;
}

public InputInvoiceMessageContent suggestedTipAmount(Integer[] suggestedTipAmount) {
this.suggested_tip_amount = suggestedTipAmount;
return this;
}

public InputInvoiceMessageContent providerData(String providerData) {
this.provider_data = providerData;
return this;
}

public InputInvoiceMessageContent photoUrl(String photoUrl) {
this.photo_url = photoUrl;
return this;
}

public InputInvoiceMessageContent photoSize(Integer photoSize) {
this.photo_size = photoSize;
return this;
}

public InputInvoiceMessageContent photoWidth(Integer photoWidth) {
this.photo_width = photoWidth;
return this;
}

public InputInvoiceMessageContent photoHeight(Integer photoHeight) {
this.photo_height = photoHeight;
return this;
}

public InputInvoiceMessageContent needName(boolean needName) {
this.need_name = needName;
return this;
}

public InputInvoiceMessageContent needPhoneNumber(boolean needPhoneNumber) {
this.need_phone_number = needPhoneNumber;
return this;
}

public InputInvoiceMessageContent needEmail(boolean needEmail) {
this.need_email = needEmail;
return this;
}

public InputInvoiceMessageContent needShippingAddress(boolean needShippingAddress) {
this.need_shipping_address = needShippingAddress;
return this;
}

public InputInvoiceMessageContent sendPhoneNumberToProvider(boolean sendPhoneNumberToProvider) {
this.send_phone_number_to_provider = sendPhoneNumberToProvider;
return this;
}

public InputInvoiceMessageContent sendEmailToProvider(boolean sendEmailToProvider) {
this.send_email_to_provider = sendEmailToProvider;
return this;
}

public InputInvoiceMessageContent isFlexible(boolean isFlexible) {
this.is_flexible = isFlexible;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class SetPassportDataErrors extends BaseRequest<SetPassportDataErrors, BaseResponse> {

public SetPassportDataErrors(int userId, PassportElementError... errors) {
public SetPassportDataErrors(long userId, PassportElementError... errors) {
super(BaseResponse.class);
add("user_id", userId).add("errors", errors);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
public class AddStickerToSet extends AbstractUploadRequest<AddStickerToSet, BaseResponse> {

public static AddStickerToSet tgsSticker(Integer userId, String name, String emojis, Object tgsSticker) {
public static AddStickerToSet tgsSticker(Long userId, String name, String emojis, Object tgsSticker) {
return new AddStickerToSet(userId, name, emojis, "tgs_sticker", tgsSticker);
}

public AddStickerToSet(Integer userId, String name, Object pngSticker, String emojis) {
public AddStickerToSet(Long userId, String name, Object pngSticker, String emojis) {
this(userId, name, emojis, "png_sticker", pngSticker);
}

private AddStickerToSet(Integer userId, String name, String emojis, String stickerParam, Object sticker) {
private AddStickerToSet(Long userId, String name, String emojis, String stickerParam, Object sticker) {
super(BaseResponse.class, stickerParam, sticker);
add("user_id", userId);
add("name", name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
public class CreateNewStickerSet extends AbstractUploadRequest<CreateNewStickerSet, BaseResponse> {

public static CreateNewStickerSet tgsSticker(Integer userId, String name, String title, String emojis, Object tgsSticker) {
public static CreateNewStickerSet tgsSticker(Long userId, String name, String title, String emojis, Object tgsSticker) {
return new CreateNewStickerSet(userId, name, title, emojis, "tgs_sticker", tgsSticker);
}

public CreateNewStickerSet(Integer userId, String name, String title, Object pngSticker, String emojis) {
public CreateNewStickerSet(Long userId, String name, String title, Object pngSticker, String emojis) {
this(userId, name, title, emojis, "png_sticker", pngSticker);
}

private CreateNewStickerSet(Integer userId, String name, String title, String emojis, String stickerParam, Object sticker) {
private CreateNewStickerSet(Long userId, String name, String title, String emojis, String stickerParam, Object sticker) {
super(BaseResponse.class, stickerParam, sticker);
add("user_id", userId);
add("name", name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class GetChatMember extends BaseRequest<GetChatMember, GetChatMemberResponse> {

public GetChatMember(Object chatId, int userId) {
public GetChatMember(Object chatId, long userId) {
super(GetChatMemberResponse.class);
add("chat_id", chatId).add("user_id", userId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
*/
public class GetGameHighScores extends BaseRequest<GetGameHighScores, GetGameHighScoresResponse> {

public GetGameHighScores(int userId, Object chatId, int messageId) {
public GetGameHighScores(long userId, Object chatId, int messageId) {
super(GetGameHighScoresResponse.class);
add("user_id", userId).add("chat_id", chatId).add("message_id", messageId);
}

public GetGameHighScores(int userId, String inlineMessageId) {
public GetGameHighScores(long userId, String inlineMessageId) {
super(GetGameHighScoresResponse.class);
add("user_id", userId).add("inline_message_id", inlineMessageId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class GetUserProfilePhotos extends BaseRequest<GetUserProfilePhotos, GetUserProfilePhotosResponse> {

public GetUserProfilePhotos(int userId) {
public GetUserProfilePhotos(long userId) {
super(GetUserProfilePhotosResponse.class);
add("user_id", userId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class KickChatMember extends BaseRequest<KickChatMember, BaseResponse> {

public KickChatMember(Object chatId, int userId) {
public KickChatMember(Object chatId, long userId) {
super(BaseResponse.class);
add("chat_id", chatId).add("user_id", userId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class PromoteChatMember extends BaseRequest<PromoteChatMember, BaseResponse> {

public PromoteChatMember(Object chatId, int userId) {
public PromoteChatMember(Object chatId, long userId) {
super(BaseResponse.class);
add("chat_id", chatId).add("user_id", userId);
}
Expand Down
Loading