Skip to content

Commit cceccfd

Browse files
committed
Api Version 8.2
1 parent a45087a commit cceccfd

File tree

19 files changed

+366
-37
lines changed

19 files changed

+366
-37
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
99
<packaging>pom</packaging>
10-
<version>8.1.0</version>
10+
<version>8.2.0</version>
1111

1212
<modules>
1313
<module>telegrambots-meta</module>

telegrambots-abilities/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.1.0</version>
10+
<version>8.2.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-abilities</artifactId>
@@ -104,12 +104,12 @@
104104
<dependency>
105105
<groupId>org.telegram</groupId>
106106
<artifactId>telegrambots-webhook</artifactId>
107-
<version>8.1.0</version>
107+
<version>8.2.0</version>
108108
</dependency>
109109
<dependency>
110110
<groupId>org.telegram</groupId>
111111
<artifactId>telegrambots-longpolling</artifactId>
112-
<version>8.1.0</version>
112+
<version>8.2.0</version>
113113
</dependency>
114114

115115
<dependency>

telegrambots-client-jetty-adapter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.1.0</version>
10+
<version>8.2.0</version>
1111
</parent>
1212

1313
<name>Telegram Bots Client Jetty HttpClient adapter</name>

telegrambots-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.1.0</version>
10+
<version>8.2.0</version>
1111
</parent>
1212

1313
<name>Telegram Bots Client</name>

telegrambots-extensions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
1616
<dependency>
1717
<groupId>org.telegram</groupId>
1818
<artifactId>telegrambots-extensions</artifactId>
19-
<version>8.1.0</version>
19+
<version>8.2.0</version>
2020
</dependency>
2121
```
2222

2323
2. Using Gradle:
2424

2525
```gradle
26-
implementation 'org.telegram:telegrambots-extensions:8.1.0'
26+
implementation 'org.telegram:telegrambots-extensions:8.2.0'
2727
```

telegrambots-extensions/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.1.0</version>
10+
<version>8.2.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-extensions</artifactId>
@@ -89,12 +89,12 @@
8989
<dependency>
9090
<groupId>org.telegram</groupId>
9191
<artifactId>telegrambots-webhook</artifactId>
92-
<version>8.1.0</version>
92+
<version>8.2.0</version>
9393
</dependency>
9494
<dependency>
9595
<groupId>org.telegram</groupId>
9696
<artifactId>telegrambots-longpolling</artifactId>
97-
<version>8.1.0</version>
97+
<version>8.2.0</version>
9898
</dependency>
9999

100100
<dependency>

telegrambots-longpolling/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
9-
<version>8.1.0</version>
9+
<version>8.2.0</version>
1010
</parent>
1111

1212
<artifactId>telegrambots-longpolling</artifactId>

telegrambots-meta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>8.1.0</version>
10+
<version>8.2.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-meta</artifactId>

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/SendGift.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class SendGift extends BotApiMethodBoolean {
4646
private static final String TEXT_FIELD = "text";
4747
private static final String TEXT_PARSE_MODE_FIELD = "text_parse_mode";
4848
private static final String TEXT_ENTITIES_FIELD = "text_entities";
49+
private static final String PAY_FOR_UPGRADE_FIELD = "pay_for_upgrade";
4950

5051
/**
5152
* Unique identifier of the target user that will receive the gift
@@ -83,6 +84,12 @@ public class SendGift extends BotApiMethodBoolean {
8384
@JsonProperty(TEXT_ENTITIES_FIELD)
8485
@Singular
8586
private List<MessageEntity> textEntities;
87+
/**
88+
* Optional
89+
* Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
90+
*/
91+
@JsonProperty(PAY_FOR_UPGRADE_FIELD)
92+
private Boolean payForUpgrade;
8693

8794
@Override
8895
public void validate() throws TelegramApiValidationException {
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package org.telegram.telegrambots.meta.api.methods.verification;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
import lombok.EqualsAndHashCode;
7+
import lombok.Getter;
8+
import lombok.NonNull;
9+
import lombok.RequiredArgsConstructor;
10+
import lombok.Setter;
11+
import lombok.ToString;
12+
import lombok.experimental.SuperBuilder;
13+
import lombok.experimental.Tolerate;
14+
import lombok.extern.jackson.Jacksonized;
15+
import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean;
16+
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
17+
import org.telegram.telegrambots.meta.util.Validations;
18+
19+
/**
20+
* @author Ruben Bermudez
21+
* @version 8.2
22+
*
23+
* Removes verification from a chat that is currently verified on behalf of the organization represented by the bot.
24+
* Returns True on success.
25+
*/
26+
@EqualsAndHashCode(callSuper = false)
27+
@Getter
28+
@Setter
29+
@ToString
30+
@RequiredArgsConstructor
31+
@SuperBuilder
32+
@Jacksonized
33+
@JsonIgnoreProperties(ignoreUnknown = true)
34+
@JsonInclude(JsonInclude.Include.NON_NULL)
35+
public class RemoveChatVerification extends BotApiMethodBoolean {
36+
public static final String PATH = "removeChatVerification";
37+
38+
private static final String CHAT_ID_FIELD = "chat_id";
39+
40+
/**
41+
* Unique identifier for the target chat or username of the target channel (in the format @channelusername)
42+
*/
43+
@JsonProperty(CHAT_ID_FIELD)
44+
@NonNull
45+
private String chatId;
46+
47+
@Override
48+
public void validate() throws TelegramApiValidationException {
49+
Validations.requiredChatId(chatId, this);
50+
}
51+
52+
@Override
53+
public String getMethod() {
54+
return PATH;
55+
}
56+
57+
@Tolerate
58+
public void setChatId(@NonNull Long chatId) {
59+
this.chatId = chatId.toString();
60+
}
61+
62+
public abstract static class RemoveChatVerificationBuilder<C extends RemoveChatVerification, B extends RemoveChatVerification.RemoveChatVerificationBuilder<C, B>> extends BotApiMethodBooleanBuilder<C, B> {
63+
@Tolerate
64+
public RemoveChatVerification.RemoveChatVerificationBuilder<C, B> chatId(@NonNull Long chatId) {
65+
this.chatId = chatId.toString();
66+
return this;
67+
}
68+
}
69+
}

0 commit comments

Comments
 (0)