Skip to content

Commit f501d8b

Browse files
authored
Merge pull request #388 from mircoianese/api_v7.5
BOT API v7.5
2 parents c3a5449 + 691b0ee commit f501d8b

35 files changed

+603
-10
lines changed

library/src/main/java/com/pengrad/telegrambot/model/ChatMember.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public Boolean canDeleteMessages() {
9292
/**
9393
* @deprecated Use canManageVideoChats() instead
9494
*/
95+
@Deprecated
9596
public Boolean canManageVoiceChats() {
9697
return canManageVideoChats();
9798
}

library/src/main/java/com/pengrad/telegrambot/model/business/BusinessConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class BusinessConnection {
88

99
private String id;
1010
private User user;
11-
private Integer user_chat_id;
11+
private Long user_chat_id;
1212
private Integer date;
1313
private Boolean can_reply;
1414
private Boolean is_enabled;
@@ -21,7 +21,7 @@ public User user() {
2121
return user;
2222
}
2323

24-
public Integer userChatId() {
24+
public Long userChatId() {
2525
return user_chat_id;
2626
}
2727

library/src/main/java/com/pengrad/telegrambot/model/message/origin/MessageOrigin.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public class MessageOrigin implements Serializable {
99
protected String type;
1010
protected Integer date;
1111

12+
public MessageOrigin(String type) {
13+
this.type = type;
14+
}
15+
1216
public String type() {
1317
return type;
1418
}

library/src/main/java/com/pengrad/telegrambot/model/message/origin/MessageOriginChannel.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ public class MessageOriginChannel extends MessageOrigin {
1313

1414
private String author_signature;
1515

16+
public MessageOriginChannel() {
17+
super(MESSAGE_ORIGIN_TYPE);
18+
}
19+
1620
public Chat chat() {
1721
return chat;
1822
}

library/src/main/java/com/pengrad/telegrambot/model/message/origin/MessageOriginChat.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public class MessageOriginChat extends MessageOrigin {
1111
private Chat sender_chat;
1212
private String author_signature;
1313

14+
public MessageOriginChat() {
15+
super(MESSAGE_ORIGIN_TYPE);
16+
}
1417
public Chat senderChat() {
1518
return sender_chat;
1619
}

library/src/main/java/com/pengrad/telegrambot/model/message/origin/MessageOriginHiddenUser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ public class MessageOriginHiddenUser extends MessageOrigin {
88

99
private String sender_user_name;
1010

11+
public MessageOriginHiddenUser() {
12+
super(MESSAGE_ORIGIN_TYPE);
13+
}
14+
1115
public String senderUserName() {
1216
return sender_user_name;
1317
}

library/src/main/java/com/pengrad/telegrambot/model/message/origin/MessageOriginUser.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ public class MessageOriginUser extends MessageOrigin {
1010

1111
private User sender_user;
1212

13+
public MessageOriginUser() {
14+
super(MESSAGE_ORIGIN_TYPE);
15+
}
1316
public User senderUser() {
1417
return sender_user;
1518
}

library/src/main/java/com/pengrad/telegrambot/model/request/InputInvoiceMessageContent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public InputInvoiceMessageContent(String title, String description, String paylo
4747
* Backward compatibility: API 7.4, parameter "provider_token" became optional
4848
* @deprecated Use constrcutor without 'provider_token' instead
4949
*/
50+
@Deprecated
5051
public InputInvoiceMessageContent(String title, String description, String payload, String providerToken, String currency, LabeledPrice[] prices) {
5152
this.title = title;
5253
this.description = description;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.pengrad.telegrambot.model.stars;
2+
3+
import com.pengrad.telegrambot.model.stars.partner.TransactionPartner;
4+
5+
import java.io.Serializable;
6+
import java.util.Objects;
7+
8+
public class StarTransaction implements Serializable {
9+
10+
private final static long serialVersionUID = 0L;
11+
12+
private String id;
13+
private Integer amount;
14+
private Integer date;
15+
16+
private TransactionPartner source;
17+
18+
private TransactionPartner receiver;
19+
20+
21+
public String id() {
22+
return id;
23+
}
24+
25+
public Integer amount() {
26+
return amount;
27+
}
28+
29+
public Integer date() {
30+
return date;
31+
}
32+
33+
public TransactionPartner source() {
34+
return source;
35+
}
36+
37+
public TransactionPartner receiver() {
38+
return receiver;
39+
}
40+
41+
@Override
42+
public boolean equals(Object o) {
43+
if (this == o) return true;
44+
if (o == null || getClass() != o.getClass()) return false;
45+
46+
StarTransaction that = (StarTransaction) o;
47+
return Objects.equals(id, that.id) &&
48+
Objects.equals(amount, that.amount) &&
49+
Objects.equals(date, that.date) &&
50+
Objects.equals(source, that.source) &&
51+
Objects.equals(receiver, that.receiver);
52+
}
53+
54+
@Override
55+
public int hashCode() {
56+
return Objects.hash(id, amount, date, source, receiver);
57+
}
58+
59+
@Override
60+
public String toString() {
61+
return "StarTransaction{" +
62+
"id='" + id + "'," +
63+
"amount='" + amount + "'," +
64+
"date='" + date + "'," +
65+
"source='" + source + "'," +
66+
"receiver='" + receiver + "'" +
67+
'}';
68+
}
69+
70+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.pengrad.telegrambot.model.stars;
2+
3+
import java.io.Serializable;
4+
import java.util.Arrays;
5+
import java.util.Objects;
6+
7+
public class StarTransactions implements Serializable {
8+
9+
private final static long serialVersionUID = 0L;
10+
11+
private StarTransaction[] transactions;
12+
13+
public StarTransaction[] transactions() {
14+
return transactions;
15+
}
16+
17+
@Override
18+
public boolean equals(Object o) {
19+
if (this == o) return true;
20+
if (o == null || getClass() != o.getClass()) return false;
21+
22+
StarTransactions that = (StarTransactions) o;
23+
return Arrays.equals(transactions, that.transactions);
24+
}
25+
26+
@Override
27+
public int hashCode() {
28+
return Arrays.hashCode(transactions);
29+
}
30+
31+
@Override
32+
public String toString() {
33+
return "StarTransactions{" +
34+
"transactions='" + Arrays.toString(transactions) + "'" +
35+
'}';
36+
}
37+
38+
}

0 commit comments

Comments
 (0)