Skip to content

Commit 33e0f1d

Browse files
authored
Merge pull request #311 from mircoianese/api_6.5
BOT Api v6.5
2 parents b5616fe + b5533ab commit 33e0f1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+702
-68
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![codecov](https://codecov.io/gh/pengrad/java-telegram-bot-api/branch/master/graph/badge.svg)](https://codecov.io/gh/pengrad/java-telegram-bot-api)
66

77
Java library for interacting with [Telegram Bot API](https://core.telegram.org/bots/api)
8-
- Full support of all Bot API 6.3 methods
8+
- Full support of all Bot API 6.5 methods
99
- Telegram [Passport](https://core.telegram.org/passport) and Decryption API
1010
- Bot [Payments](https://core.telegram.org/bots/payments)
1111
- [Gaming Platform](https://telegram.org/blog/games)
@@ -14,14 +14,14 @@ Java library for interacting with [Telegram Bot API](https://core.telegram.org/b
1414

1515
Gradle:
1616
```groovy
17-
implementation 'com.github.pengrad:java-telegram-bot-api:6.3.0'
17+
implementation 'com.github.pengrad:java-telegram-bot-api:6.5.0'
1818
```
1919
Maven:
2020
```xml
2121
<dependency>
2222
<groupId>com.github.pengrad</groupId>
2323
<artifactId>java-telegram-bot-api</artifactId>
24-
<version>6.3.0</version>
24+
<version>6.5.0</version>
2525
</dependency>
2626
```
2727
[JAR with all dependencies on release page](https://github.com/pengrad/java-telegram-bot-api/releases)

README_RU.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![codecov](https://codecov.io/gh/pengrad/java-telegram-bot-api/branch/master/graph/badge.svg)](https://codecov.io/gh/pengrad/java-telegram-bot-api)
55

66
Java библиотека, созданная для работы с [Telegram Bot API](https://core.telegram.org/bots/api)
7-
- Полная поддержка всех методов BOT API 6.3
7+
- Полная поддержка всех методов BOT API 6.5
88
- Поддержка Telegram [паспорта](https://core.telegram.org/passport) и дешифровки (Decryption API);
99
- Поддержка [платежей](https://core.telegram.org/bots/payments);
1010
- [Игровая платформа](https://telegram.org/blog/games).
@@ -13,14 +13,14 @@ Java библиотека, созданная для работы с [Telegram B
1313

1414
Gradle:
1515
```groovy
16-
implementation 'com.github.pengrad:java-telegram-bot-api:6.3.0'
16+
implementation 'com.github.pengrad:java-telegram-bot-api:6.5.0'
1717
```
1818
Maven:
1919
```xml
2020
<dependency>
2121
<groupId>com.github.pengrad</groupId>
2222
<artifactId>java-telegram-bot-api</artifactId>
23-
<version>6.3.0</version>
23+
<version>6.5.0</version>
2424
</dependency>
2525
```
2626
Также JAR со всеми зависимостями можно найти [в релизах](https://github.com/pengrad/java-telegram-bot-api/releases).

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.github.pengrad
2-
VERSION_NAME=6.3.0
2+
VERSION_NAME=6.5.0
33

44
POM_DESCRIPTION=Java API for Telegram Bot API
55
POM_URL=https://github.com/pengrad/java-telegram-bot-api/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public enum Type {
3737
private String bio;
3838
private Boolean has_private_forwards;
3939
private Boolean has_restricted_voice_and_video_messages;
40+
private Boolean has_hidden_members;
41+
private Boolean has_aggressive_anti_spam_enabled;
4042
private Boolean join_to_send_messages;
4143
private Boolean join_by_request;
4244
private String description;
@@ -103,6 +105,14 @@ public Boolean hasRestrictedVoiceAndVideoMessages() {
103105
return has_restricted_voice_and_video_messages != null && has_restricted_voice_and_video_messages;
104106
}
105107

108+
public Boolean hasHiddenMembers() {
109+
return has_hidden_members != null && has_hidden_members;
110+
}
111+
112+
public Boolean hasAggressiveAntiSpamEnabled() {
113+
return has_aggressive_anti_spam_enabled != null && has_aggressive_anti_spam_enabled;
114+
}
115+
106116
public Boolean joinToSendMessages() {
107117
return join_to_send_messages != null && join_to_send_messages;
108118
}
@@ -173,6 +183,8 @@ public boolean equals(Object o) {
173183
Objects.equals(bio, chat.bio) &&
174184
Objects.equals(has_private_forwards, chat.has_private_forwards) &&
175185
Objects.equals(has_restricted_voice_and_video_messages, chat.has_restricted_voice_and_video_messages) &&
186+
Objects.equals(has_hidden_members, chat.has_hidden_members) &&
187+
Objects.equals(has_aggressive_anti_spam_enabled, chat.has_aggressive_anti_spam_enabled) &&
176188
Objects.equals(join_to_send_messages, chat.join_to_send_messages) &&
177189
Objects.equals(join_by_request, chat.join_by_request) &&
178190
Objects.equals(description, chat.description) &&
@@ -209,6 +221,8 @@ public String toString() {
209221
", bio='" + bio + '\'' +
210222
", has_private_forwards=" + has_private_forwards +
211223
", has_restricted_voice_and_video_messages=" + has_restricted_voice_and_video_messages +
224+
", has_hidden_members=" + has_hidden_members +
225+
", has_aggressive_anti_spam_enabled=" + has_aggressive_anti_spam_enabled +
212226
", join_to_send_messages=" + join_to_send_messages +
213227
", join_by_request=" + join_by_request +
214228
", description='" + description + '\'' +

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class ChatJoinRequest implements Serializable {
1212

1313
private Chat chat;
1414
private User from;
15+
private Long user_chat_id;
1516
private Integer date;
1617
private String bio;
1718
private ChatInviteLink invite_link;
@@ -24,6 +25,10 @@ public User from() {
2425
return from;
2526
}
2627

28+
public Long userChatId() {
29+
return user_chat_id;
30+
}
31+
2732
public Integer date() {
2833
return date;
2934
}
@@ -44,21 +49,23 @@ public boolean equals(Object o) {
4449
ChatJoinRequest that = (ChatJoinRequest) o;
4550
return Objects.equals(chat, that.chat) &&
4651
Objects.equals(from, that.from) &&
52+
Objects.equals(user_chat_id, that.user_chat_id) &&
4753
Objects.equals(date, that.date) &&
4854
Objects.equals(bio, that.bio) &&
4955
Objects.equals(invite_link, that.invite_link);
5056
}
5157

5258
@Override
5359
public int hashCode() {
54-
return Objects.hash(chat, from, date, bio, invite_link);
60+
return Objects.hash(chat, from, user_chat_id, date, bio, invite_link);
5561
}
5662

5763
@Override
5864
public String toString() {
5965
return "ChatJoinRequest{" +
6066
"chat=" + chat +
6167
", from=" + from +
68+
", user_chat_id=" + user_chat_id +
6269
", date=" + date +
6370
", bio=" + bio +
6471
", invite_link=" + invite_link +

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

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ public enum Status {
3434
private Boolean can_manage_topics;
3535
private Boolean is_member;
3636
private Boolean can_send_messages;
37-
private Boolean can_send_media_messages;
37+
38+
private Boolean can_send_audios;
39+
private Boolean can_send_documents;
40+
private Boolean can_send_photos;
41+
private Boolean can_send_videos;
42+
private Boolean can_send_video_notes;
43+
private Boolean can_send_voice_notes;
44+
3845
private Boolean can_send_polls;
3946
private Boolean can_send_other_messages;
4047
private Boolean can_add_web_page_previews;
@@ -122,8 +129,28 @@ public Boolean canSendMessages() {
122129
return can_send_messages;
123130
}
124131

125-
public Boolean canSendMediaMessages() {
126-
return can_send_media_messages;
132+
public Boolean canSendAudios() {
133+
return can_send_audios;
134+
}
135+
136+
public Boolean canSendDocuments() {
137+
return can_send_documents;
138+
}
139+
140+
public Boolean canSendPhotos() {
141+
return can_send_photos;
142+
}
143+
144+
public Boolean canSendVideos() {
145+
return can_send_videos;
146+
}
147+
148+
public Boolean canSendVideoNotes() {
149+
return can_send_video_notes;
150+
}
151+
152+
public Boolean canSendVoiceNotes() {
153+
return can_send_voice_notes;
127154
}
128155

129156
public Boolean canSendPolls() {
@@ -162,7 +189,12 @@ public boolean equals(Object o) {
162189
Objects.equals(can_manage_topics, that.can_manage_topics) &&
163190
Objects.equals(is_member, that.is_member) &&
164191
Objects.equals(can_send_messages, that.can_send_messages) &&
165-
Objects.equals(can_send_media_messages, that.can_send_media_messages) &&
192+
Objects.equals(can_send_audios, that.can_send_audios) &&
193+
Objects.equals(can_send_documents, that.can_send_documents) &&
194+
Objects.equals(can_send_photos, that.can_send_photos) &&
195+
Objects.equals(can_send_videos, that.can_send_videos) &&
196+
Objects.equals(can_send_video_notes, that.can_send_video_notes) &&
197+
Objects.equals(can_send_voice_notes, that.can_send_voice_notes) &&
166198
Objects.equals(can_send_polls, that.can_send_polls) &&
167199
Objects.equals(can_send_other_messages, that.can_send_other_messages) &&
168200
Objects.equals(can_add_web_page_previews, that.can_add_web_page_previews);
@@ -189,7 +221,12 @@ public int hashCode() {
189221
can_manage_topics,
190222
is_member,
191223
can_send_messages,
192-
can_send_media_messages,
224+
can_send_audios,
225+
can_send_documents,
226+
can_send_photos,
227+
can_send_videos,
228+
can_send_video_notes,
229+
can_send_voice_notes,
193230
can_send_polls,
194231
can_send_other_messages,
195232
can_add_web_page_previews);
@@ -217,7 +254,12 @@ public String toString() {
217254
", can_manage_topics=" + can_manage_topics +
218255
", is_member=" + is_member +
219256
", can_send_messages=" + can_send_messages +
220-
", can_send_media_messages=" + can_send_media_messages +
257+
", can_send_audios=" + can_send_audios +
258+
", can_send_documents=" + can_send_documents +
259+
", can_send_photos=" + can_send_photos +
260+
", can_send_videos=" + can_send_videos +
261+
", can_send_video_notes=" + can_send_video_notes +
262+
", can_send_voice_notes=" + can_send_voice_notes +
221263
", can_send_polls=" + can_send_polls +
222264
", can_send_other_messages=" + can_send_other_messages +
223265
", can_add_web_page_previews=" + can_add_web_page_previews +

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

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ public class ChatPermissions implements Serializable {
1111
private final static long serialVersionUID = 0L;
1212

1313
private Boolean can_send_messages;
14-
private Boolean can_send_media_messages;
14+
15+
private Boolean can_send_audios;
16+
private Boolean can_send_documents;
17+
private Boolean can_send_photos;
18+
private Boolean can_send_videos;
19+
private Boolean can_send_video_notes;
20+
private Boolean can_send_voice_notes;
21+
1522
private Boolean can_send_polls;
1623
private Boolean can_send_other_messages;
1724
private Boolean can_add_web_page_previews;
@@ -24,8 +31,28 @@ public Boolean canSendMessages() {
2431
return can_send_messages;
2532
}
2633

27-
public Boolean canSendMediaMessages() {
28-
return can_send_media_messages;
34+
public Boolean canSendAudios() {
35+
return can_send_audios;
36+
}
37+
38+
public Boolean canSendDocuments() {
39+
return can_send_documents;
40+
}
41+
42+
public Boolean canSendPhotos() {
43+
return can_send_photos;
44+
}
45+
46+
public Boolean canSendVideos() {
47+
return can_send_videos;
48+
}
49+
50+
public Boolean canSendVideoNotes() {
51+
return can_send_video_notes;
52+
}
53+
54+
public Boolean canSendVoiceNotes() {
55+
return can_send_voice_notes;
2956
}
3057

3158
public Boolean canSendPolls() {
@@ -61,8 +88,33 @@ public ChatPermissions canSendMessages(boolean canSendMessages) {
6188
return this;
6289
}
6390

64-
public ChatPermissions canSendMediaMessages(boolean canSendMediaMessages) {
65-
can_send_media_messages = canSendMediaMessages;
91+
public ChatPermissions canSendAudios(boolean canSendAudios) {
92+
this.can_send_audios = canSendAudios;
93+
return this;
94+
}
95+
96+
public ChatPermissions canSendDocuments(boolean canSendDocuments) {
97+
this.can_send_documents = canSendDocuments;
98+
return this;
99+
}
100+
101+
public ChatPermissions canSendPhotos(boolean canSendPhotos) {
102+
this.can_send_photos = canSendPhotos;
103+
return this;
104+
}
105+
106+
public ChatPermissions canSendVideos(boolean canSendVideos) {
107+
this.can_send_videos = canSendVideos;
108+
return this;
109+
}
110+
111+
public ChatPermissions canSendVideoNotes(boolean canSendVideoNotes) {
112+
this.can_send_video_notes = canSendVideoNotes;
113+
return this;
114+
}
115+
116+
public ChatPermissions canSendVoiceNotes(boolean canSendVoiceNotes) {
117+
this.can_send_voice_notes = canSendVoiceNotes;
66118
return this;
67119
}
68120

@@ -109,7 +161,12 @@ public boolean equals(Object o) {
109161
ChatPermissions that = (ChatPermissions) o;
110162

111163
return Objects.equals(can_send_messages, that.can_send_messages) &&
112-
Objects.equals(can_send_media_messages, that.can_send_media_messages) &&
164+
Objects.equals(can_send_audios, that.can_send_audios) &&
165+
Objects.equals(can_send_documents, that.can_send_documents) &&
166+
Objects.equals(can_send_photos, that.can_send_photos) &&
167+
Objects.equals(can_send_videos, that.can_send_videos) &&
168+
Objects.equals(can_send_video_notes, that.can_send_video_notes) &&
169+
Objects.equals(can_send_voice_notes, that.can_send_voice_notes) &&
113170
Objects.equals(can_send_polls, that.can_send_polls) &&
114171
Objects.equals(can_send_other_messages, that.can_send_other_messages) &&
115172
Objects.equals(can_add_web_page_previews, that.can_add_web_page_previews) &&
@@ -122,7 +179,12 @@ public boolean equals(Object o) {
122179
@Override
123180
public int hashCode() {
124181
return Objects.hash(can_send_messages,
125-
can_send_media_messages,
182+
can_send_audios,
183+
can_send_documents,
184+
can_send_photos,
185+
can_send_videos,
186+
can_send_video_notes,
187+
can_send_voice_notes,
126188
can_send_polls,
127189
can_send_other_messages,
128190
can_add_web_page_previews,
@@ -136,7 +198,12 @@ public int hashCode() {
136198
public String toString() {
137199
return "ChatPermissions{" +
138200
"can_send_messages=" + can_send_messages +
139-
", can_send_media_messages=" + can_send_media_messages +
201+
", can_send_audios=" + can_send_audios +
202+
", can_send_documents=" + can_send_documents +
203+
", can_send_photos=" + can_send_photos +
204+
", can_send_videos=" + can_send_videos +
205+
", can_send_video_notes=" + can_send_video_notes +
206+
", can_send_voice_notes=" + can_send_voice_notes +
140207
", can_send_polls=" + can_send_polls +
141208
", can_send_other_messages=" + can_send_other_messages +
142209
", can_add_web_page_previews=" + can_add_web_page_previews +

0 commit comments

Comments
 (0)