Skip to content

Commit 5f17ed1

Browse files
authored
Merge pull request #322 from mircoianese/api_6.6
BOT Api v6.6
2 parents 9c1a493 + 24b5270 commit 5f17ed1

Some content is hidden

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

45 files changed

+967
-91
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Animation implements Serializable {
1414
private Integer width;
1515
private Integer height;
1616
private Integer duration;
17-
private PhotoSize thumb;
17+
private PhotoSize thumbnail;
1818
private String file_name;
1919
private String mime_type;
2020
private Long file_size;
@@ -39,8 +39,16 @@ public Integer duration() {
3939
return duration;
4040
}
4141

42+
public PhotoSize thumbnail() {
43+
return thumbnail;
44+
}
45+
46+
/**
47+
* @deprecated Use thumbnail instead
48+
*/
49+
@Deprecated
4250
public PhotoSize thumb() {
43-
return thumb;
51+
return thumbnail;
4452
}
4553

4654
public String fileName() {
@@ -68,7 +76,7 @@ public boolean equals(Object o) {
6876
if (width != null ? !width.equals(animation.width) : animation.width != null) return false;
6977
if (height != null ? !height.equals(animation.height) : animation.height != null) return false;
7078
if (duration != null ? !duration.equals(animation.duration) : animation.duration != null) return false;
71-
if (thumb != null ? !thumb.equals(animation.thumb) : animation.thumb != null) return false;
79+
if (thumbnail != null ? !thumbnail.equals(animation.thumbnail) : animation.thumbnail != null) return false;
7280
if (file_name != null ? !file_name.equals(animation.file_name) : animation.file_name != null) return false;
7381
if (mime_type != null ? !mime_type.equals(animation.mime_type) : animation.mime_type != null) return false;
7482
return file_size != null ? file_size.equals(animation.file_size) : animation.file_size == null;
@@ -87,7 +95,7 @@ public String toString() {
8795
", width=" + width +
8896
", height=" + height +
8997
", duration=" + duration +
90-
", thumb=" + thumb +
98+
", thumbnail=" + thumbnail +
9199
", file_name='" + file_name + '\'' +
92100
", mime_type='" + mime_type + '\'' +
93101
", file_size=" + file_size +

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public class Audio implements Serializable {
1818
private String file_name;
1919
private String mime_type;
2020
private Long file_size;
21-
private PhotoSize thumb;
21+
private PhotoSize thumbnail;
22+
2223

2324
public String fileId() {
2425
return file_id;
@@ -52,8 +53,16 @@ public Long fileSize() {
5253
return file_size;
5354
}
5455

56+
public PhotoSize thumbnail() {
57+
return thumbnail;
58+
}
59+
60+
/**
61+
* @deprecated Use thumbnail instead
62+
*/
63+
@Deprecated
5564
public PhotoSize thumb() {
56-
return thumb;
65+
return thumbnail;
5766
}
5867

5968
@Override
@@ -69,7 +78,7 @@ public boolean equals(Object o) {
6978
Objects.equals(file_name, audio.file_name) &&
7079
Objects.equals(mime_type, audio.mime_type) &&
7180
Objects.equals(file_size, audio.file_size) &&
72-
Objects.equals(thumb, audio.thumb);
81+
Objects.equals(thumbnail, audio.thumbnail);
7382
}
7483

7584
@Override
@@ -88,7 +97,7 @@ public String toString() {
8897
", file_name='" + file_name + '\'' +
8998
", mime_type='" + mime_type + '\'' +
9099
", file_size=" + file_size +
91-
", thumb=" + thumb +
100+
", thumb=" + thumbnail +
92101
'}';
93102
}
94103
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.pengrad.telegrambot.model;
2+
3+
import java.io.Serializable;
4+
5+
/**
6+
* Stas Parshin
7+
* 31 March 2020
8+
*/
9+
public class BotDescription implements Serializable {
10+
private final static long serialVersionUID = 0L;
11+
12+
private String description;
13+
14+
public BotDescription(String description) {
15+
this.description = description;
16+
}
17+
18+
BotDescription() {}
19+
20+
public String description() {
21+
return description;
22+
}
23+
24+
@Override
25+
public boolean equals(Object o) {
26+
if (this == o) return true;
27+
if (o == null || getClass() != o.getClass()) return false;
28+
29+
BotDescription that = (BotDescription) o;
30+
31+
return description != null ? description.equals(that.description) : that.description == null;
32+
}
33+
34+
@Override
35+
public int hashCode() {
36+
return description != null ? description.hashCode() : 0;
37+
}
38+
39+
@Override
40+
public String toString() {
41+
return "BotDescription{" +
42+
", description='" + description + '\'' +
43+
'}';
44+
}
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.pengrad.telegrambot.model;
2+
3+
import java.io.Serializable;
4+
5+
/**
6+
* Stas Parshin
7+
* 31 March 2020
8+
*/
9+
public class BotShortDescription implements Serializable {
10+
private final static long serialVersionUID = 0L;
11+
12+
private String short_description;
13+
14+
public BotShortDescription(String shortDescription) {
15+
this.short_description = shortDescription;
16+
}
17+
18+
BotShortDescription() {}
19+
20+
public String shortDescription() {
21+
return short_description;
22+
}
23+
24+
@Override
25+
public boolean equals(Object o) {
26+
if (this == o) return true;
27+
if (o == null || getClass() != o.getClass()) return false;
28+
29+
BotShortDescription that = (BotShortDescription) o;
30+
31+
return short_description != null ? short_description.equals(that.short_description) : that.short_description == null;
32+
}
33+
34+
@Override
35+
public int hashCode() {
36+
return short_description != null ? short_description.hashCode() : 0;
37+
}
38+
39+
@Override
40+
public String toString() {
41+
return "BotShortDescription{" +
42+
", short_description='" + short_description + '\'' +
43+
'}';
44+
}
45+
}

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public class Document implements Serializable {
1111

1212
private String file_id;
1313
private String file_unique_id;
14-
private PhotoSize thumb;
14+
private PhotoSize thumbnail;
15+
1516
private String file_name;
1617
private String mime_type;
1718
private Long file_size;
@@ -24,8 +25,16 @@ public String fileUniqueId() {
2425
return file_unique_id;
2526
}
2627

28+
public PhotoSize thumbnail() {
29+
return thumbnail;
30+
}
31+
32+
/**
33+
* @deprecated Use thumbnail instead
34+
*/
35+
@Deprecated
2736
public PhotoSize thumb() {
28-
return thumb;
37+
return thumbnail;
2938
}
3039

3140
public String fileName() {
@@ -50,7 +59,7 @@ public boolean equals(Object o) {
5059
if (file_id != null ? !file_id.equals(document.file_id) : document.file_id != null) return false;
5160
if (file_unique_id != null ? !file_unique_id.equals(document.file_unique_id) : document.file_unique_id != null)
5261
return false;
53-
if (thumb != null ? !thumb.equals(document.thumb) : document.thumb != null) return false;
62+
if (thumbnail != null ? !thumbnail.equals(document.thumbnail) : document.thumbnail != null) return false;
5463
if (file_name != null ? !file_name.equals(document.file_name) : document.file_name != null) return false;
5564
if (mime_type != null ? !mime_type.equals(document.mime_type) : document.mime_type != null) return false;
5665
return file_size != null ? file_size.equals(document.file_size) : document.file_size == null;
@@ -66,7 +75,7 @@ public String toString() {
6675
return "Document{" +
6776
"file_id='" + file_id + '\'' +
6877
", file_unique_id='" + file_unique_id + '\'' +
69-
", thumb=" + thumb +
78+
", thumbnail=" + thumbnail +
7079
", file_name='" + file_name + '\'' +
7180
", mime_type='" + mime_type + '\'' +
7281
", file_size=" + file_size +

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import java.io.Serializable;
44
import java.util.Objects;
55

6+
import com.google.gson.annotations.SerializedName;
7+
68
/**
79
* stas
810
* 8/5/15.
@@ -13,6 +15,10 @@ public enum Type {
1315
regular, mask, custom_emoji
1416
}
1517

18+
public enum Format {
19+
@SerializedName("static") Static, animated, video
20+
}
21+
1622
private final static long serialVersionUID = 0L;
1723

1824
private String file_id;
@@ -22,12 +28,14 @@ public enum Type {
2228
private Integer height;
2329
private Boolean is_animated;
2430
private Boolean is_video;
25-
private PhotoSize thumb;
31+
private PhotoSize thumbnail;
32+
2633
private String emoji;
2734
private String set_name;
2835
private File premium_animation;
2936
private MaskPosition mask_position;
3037
private String custom_emoji_id;
38+
private Boolean needs_repainting;
3139
private Long file_size;
3240

3341
public String fileId() {
@@ -58,8 +66,16 @@ public Boolean isVideo() {
5866
return is_video;
5967
}
6068

69+
public PhotoSize thumbnail() {
70+
return thumbnail;
71+
}
72+
73+
/**
74+
* @deprecated Use thumbnail instead
75+
*/
76+
@Deprecated
6177
public PhotoSize thumb() {
62-
return thumb;
78+
return thumbnail;
6379
}
6480

6581
public String emoji() {
@@ -82,6 +98,10 @@ public String customEmojiId() {
8298
return custom_emoji_id;
8399
}
84100

101+
public Boolean needsRepainting() {
102+
return needs_repainting;
103+
}
104+
85105
public Long fileSize() {
86106
return file_size;
87107
}
@@ -98,12 +118,13 @@ public boolean equals(Object o) {
98118
Objects.equals(height, sticker.height) &&
99119
Objects.equals(is_animated, sticker.is_animated) &&
100120
Objects.equals(is_video, sticker.is_video) &&
101-
Objects.equals(thumb, sticker.thumb) &&
121+
Objects.equals(thumbnail, sticker.thumbnail) &&
102122
Objects.equals(emoji, sticker.emoji) &&
103123
Objects.equals(set_name, sticker.set_name) &&
104124
Objects.equals(premium_animation, sticker.premium_animation) &&
105125
Objects.equals(mask_position, sticker.mask_position) &&
106126
Objects.equals(custom_emoji_id, sticker.custom_emoji_id) &&
127+
Objects.equals(needs_repainting, sticker.needs_repainting) &&
107128
Objects.equals(file_size, sticker.file_size);
108129
}
109130

@@ -122,12 +143,13 @@ public String toString() {
122143
", height=" + height +
123144
", is_animated=" + is_animated +
124145
", is_video=" + is_video +
125-
", thumb=" + thumb +
146+
", thumbnail=" + thumbnail +
126147
", emoji='" + emoji + '\'' +
127148
", set_name='" + set_name + '\'' +
128149
", premium_animation=" + premium_animation +
129150
", mask_position=" + mask_position +
130151
", custom_emoji_id=" + custom_emoji_id +
152+
", needs_repainting=" + needs_repainting +
131153
", file_size=" + file_size +
132154
'}';
133155
}

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class StickerSet implements Serializable {
2020
private Boolean is_video;
2121
private Boolean contains_masks;
2222
private Sticker[] stickers;
23-
private PhotoSize thumb;
23+
private PhotoSize thumbnail;
24+
2425

2526
public String name() {
2627
return name;
@@ -50,8 +51,16 @@ public Sticker[] stickers() {
5051
return stickers;
5152
}
5253

54+
public PhotoSize thumbnail() {
55+
return thumbnail;
56+
}
57+
58+
/**
59+
* @deprecated Use thumbnail instead
60+
*/
61+
@Deprecated
5362
public PhotoSize thumb() {
54-
return thumb;
63+
return thumbnail;
5564
}
5665

5766
public Boolean isVideo() {
@@ -70,12 +79,12 @@ public boolean equals(Object o) {
7079
Objects.equals(is_video, that.is_video) &&
7180
Objects.equals(contains_masks, that.contains_masks) &&
7281
Arrays.equals(stickers, that.stickers) &&
73-
Objects.equals(thumb, that.thumb);
82+
Objects.equals(thumbnail, that.thumbnail);
7483
}
7584

7685
@Override
7786
public int hashCode() {
78-
int result = Objects.hash(name, title, sticker_type, is_animated, is_video, thumb);
87+
int result = Objects.hash(name, title, sticker_type, is_animated, is_video, thumbnail);
7988
result = 31 * result + Arrays.hashCode(stickers);
8089
return result;
8190
}
@@ -90,7 +99,7 @@ public String toString() {
9099
", is_video=" + is_video +
91100
", contains_masks=" + contains_masks +
92101
", stickers=" + Arrays.toString(stickers) +
93-
", thumb=" + thumb +
102+
", thumbnail=" + thumbnail +
94103
'}';
95104
}
96105
}

0 commit comments

Comments
 (0)