Merge pull request #1233 from rubenlagus/dev

Dev
This commit is contained in:
Ruben Bermudez 2023-06-11 13:33:53 +01:00 committed by GitHub
commit 7029a35cd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
164 changed files with 590 additions and 208 deletions

View File

@ -27,18 +27,18 @@ Just import add the library to your project with one of these options:
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId> <artifactId>telegrambots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
``` ```
2. Using Gradle: 2. Using Gradle:
```gradle ```gradle
implementation 'org.telegram:telegrambots:6.6.0' implementation 'org.telegram:telegrambots:6.7.0'
``` ```
3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/6.6.0) 3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/6.7.0)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/6.6.0) 4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/6.7.0)
In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`. In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`.

View File

@ -1,3 +1,8 @@
### <a id="6.7.0"></a>6.7.0 ###
1. Update Api version [6.7](https://core.telegram.org/bots/api-changelog#april-21-2023)
**[[How to update to version 6.7.0|How-To-Update#6.7.0]]**
### <a id="6.6.0"></a>6.6.0 ### ### <a id="6.6.0"></a>6.6.0 ###
1. Update Api version [6.6](https://core.telegram.org/bots/api-changelog#march-9-2023) 1. Update Api version [6.6](https://core.telegram.org/bots/api-changelog#march-9-2023)

View File

@ -11,13 +11,13 @@ First you need to acquire the library and add it to your project. There are seve
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId> <artifactId>telegrambots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
``` ```
* With **Gradle**: * With **Gradle**:
```gradle ```gradle
implementation 'org.telegram:telegrambots:6.6.0' implementation 'org.telegram:telegrambots:6.7.0'
``` ```
2. Don't like the **Maven Central Repository**? It can also be grabbed from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots). 2. Don't like the **Maven Central Repository**? It can also be grabbed from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots).

View File

@ -1,3 +1,10 @@
### <a id="6.7.0"></a>To version 6.7.0 ###
1. Api methods with thumbnails have changed the field, use getThumbnail()/setThumbnail() instead of getThumb()/setThumb()
2. In `AddStickerToSet`/`CreateNewStickerSet`/`UploadStickerFile`/etc, use field `sticker` instead of the deprecated fields.
3. `ChatMember` has more details permissions, use those instead of the legacy general ones.
4. All classes with mandatory fields will lose the default no-arg constructor in the future.
5. In `AnswerInlineQuery`, start using the `button` field instead of deprecated parameters.
### <a id="6.1.0"></a>To version 6.1.0 ### ### <a id="6.1.0"></a>To version 6.1.0 ###
1. As per API guidelines, FileSize can now have 64 bits size, hence they are now using Long datatype instead of Integer. 1. As per API guidelines, FileSize can now have 64 bits size, hence they are now using Long datatype instead of Integer.
2. Methods accept chatId as Long or String. 2. Methods accept chatId as Long or String.

View File

@ -9,12 +9,12 @@ As with any Java project, you will need to set your dependencies.
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId> <artifactId>telegrambots-abilities</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
``` ```
* **Gradle** * **Gradle**
```gradle ```gradle
implementation 'org.telegram:telegrambots-abilities:6.6.0' implementation 'org.telegram:telegrambots-abilities:6.7.0'
``` ```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots) * [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)

View File

@ -7,7 +7,7 @@
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>Bots</artifactId> <artifactId>Bots</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>6.6.0</version> <version>6.7.0</version>
<modules> <modules>
<module>telegrambots</module> <module>telegrambots</module>

View File

@ -18,14 +18,14 @@ Usage
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId> <artifactId>telegrambots-abilities</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
``` ```
**Gradle** **Gradle**
```gradle ```gradle
implementation 'org.telegram:telegrambots-abilities:6.6.0' implementation 'org.telegram:telegrambots-abilities:6.7.0'
``` ```
**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1) **JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1)

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>Bots</artifactId> <artifactId>Bots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</parent> </parent>
<artifactId>telegrambots-abilities</artifactId> <artifactId>telegrambots-abilities</artifactId>
@ -84,7 +84,7 @@
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId> <artifactId>telegrambots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>

View File

@ -3,7 +3,7 @@ package org.telegram.abilitybots.api.objects;
import org.telegram.abilitybots.api.objects.Ability.AbilityBuilder; import org.telegram.abilitybots.api.objects.Ability.AbilityBuilder;
import org.telegram.telegrambots.meta.api.objects.Update; import org.telegram.telegrambots.meta.api.objects.Update;
import java.util.function.Consumer; import java.util.function.BiConsumer;
import java.util.function.Predicate; import java.util.function.Predicate;
import static java.util.Objects.nonNull; import static java.util.Objects.nonNull;
@ -11,7 +11,7 @@ import static java.util.Objects.nonNull;
/** /**
* Flags are an conditions that are applied on an {@link Update}. * Flags are an conditions that are applied on an {@link Update}.
* <p> * <p>
* They can be used on {@link AbilityBuilder#flag(Predicate[])} and on the post conditions in {@link AbilityBuilder#reply(Consumer, Predicate[])}. * They can be used on {@link AbilityBuilder#flag(Predicate[])} and on the post conditions in {@link AbilityBuilder#reply(BiConsumer, Predicate[])}.
* *
* @author Abbas Abou Daya * @author Abbas Abou Daya
*/ */

View File

@ -9,7 +9,6 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -18,7 +17,7 @@ import static com.google.common.collect.Lists.newArrayList;
/** /**
* A reply consists of update conditionals and an action to be applied on the update. * A reply consists of update conditionals and an action to be applied on the update.
* <p> * <p>
* If an update satisfies the {@link Reply#conditions} set by the reply, then it's safe to {@link Reply#actOn(Update)}. * If an update satisfies the {@link Reply#conditions} set by the reply, then it's safe to {@link Reply#actOn(BaseAbilityBot, Update)}.
* *
* @author Abbas Abou Daya * @author Abbas Abou Daya
*/ */

View File

@ -12,7 +12,6 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Stream; import java.util.stream.Stream;

View File

@ -14,7 +14,10 @@ import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.only;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
class SilentSenderTest { class SilentSenderTest {
private SilentSender silent; private SilentSender silent;
@ -55,7 +58,7 @@ class SilentSenderTest {
verify(sender, only()).executeAsync(methodObject, callback); verify(sender, only()).executeAsync(methodObject, callback);
} }
private class NoOpCallback implements SentCallback<Message> { private static class NoOpCallback implements SentCallback<Message> {
@Override @Override
public void onResult(BotApiMethod<Message> method, Message response) { public void onResult(BotApiMethod<Message> method, Message response) {

View File

@ -7,12 +7,14 @@ import org.telegram.abilitybots.api.bot.DefaultAbilities;
import org.telegram.abilitybots.api.bot.DefaultBot; import org.telegram.abilitybots.api.bot.DefaultBot;
import org.telegram.abilitybots.api.db.DBContext; import org.telegram.abilitybots.api.db.DBContext;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Properties; import java.util.Properties;
import static org.apache.commons.lang3.StringUtils.EMPTY; import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.telegram.abilitybots.api.db.MapDBContext.offlineInstance; import static org.telegram.abilitybots.api.db.MapDBContext.offlineInstance;
class CustomToggleTest { class CustomToggleTest {
@ -55,7 +57,7 @@ class CustomToggleTest {
public void canTurnOffAbilitiesThroughProperties() { public void canTurnOffAbilitiesThroughProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
try { try {
properties.load(new FileInputStream(filename)); properties.load(Files.newInputStream(Paths.get(filename)));
toggle = new CustomToggle().config(properties); toggle = new CustomToggle().config(properties);
} catch (IOException e) { } catch (IOException e) {
System.out.println("No such file"); System.out.println("No such file");
@ -71,7 +73,7 @@ class CustomToggleTest {
public void canProcessAbilitiesThroughProperties() { public void canProcessAbilitiesThroughProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
try { try {
properties.load(new FileInputStream(filename)); properties.load(Files.newInputStream(Paths.get(filename)));
toggle = new CustomToggle().config(properties); toggle = new CustomToggle().config(properties);
} catch (IOException e) { } catch (IOException e) {
System.out.println("No such file"); System.out.println("No such file");

View File

@ -15,14 +15,14 @@ Usage
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots-chat-session-bot</artifactId> <artifactId>telegrambots-chat-session-bot</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
``` ```
**Gradle** **Gradle**
```gradle ```gradle
implementation 'org.telegram:telegrambots-chat-session-bot:6.6.0' implementation 'org.telegram:telegrambots-chat-session-bot:6.7.0'
``` ```
Motivation Motivation

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>Bots</artifactId> <artifactId>Bots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</parent> </parent>
<artifactId>telegrambots-chat-session-bot</artifactId> <artifactId>telegrambots-chat-session-bot</artifactId>
@ -84,7 +84,7 @@
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId> <artifactId>telegrambots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core --> <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->

View File

@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambotsextensions</artifactId> <artifactId>telegrambotsextensions</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
``` ```
2. Using Gradle: 2. Using Gradle:
```gradle ```gradle
implementation 'org.telegram:telegrambotsextensions:6.6.0' implementation 'org.telegram:telegrambotsextensions:6.7.0'
``` ```

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>Bots</artifactId> <artifactId>Bots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</parent> </parent>
<artifactId>telegrambotsextensions</artifactId> <artifactId>telegrambotsextensions</artifactId>
@ -75,7 +75,7 @@
<dependency> <dependency>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId> <artifactId>telegrambots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -42,7 +42,7 @@ public class HelpCommand extends ManCommand {
* @return a formatted String containing command and description for all supplied commands * @return a formatted String containing command and description for all supplied commands
*/ */
public static String getHelpText(Collection<IBotCommand> botCommands) { public static String getHelpText(Collection<IBotCommand> botCommands) {
return getHelpText(botCommands.toArray(new IBotCommand[botCommands.size()])); return getHelpText(botCommands.toArray(new IBotCommand[0]));
} }
/** /**

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.telegram</groupId> <groupId>org.telegram</groupId>
<artifactId>Bots</artifactId> <artifactId>Bots</artifactId>
<version>6.6.0</version> <version>6.7.0</version>
</parent> </parent>
<artifactId>telegrambots-meta</artifactId> <artifactId>telegrambots-meta</artifactId>

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBool
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -11,8 +11,10 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter; import lombok.Setter;
import lombok.Singular; import lombok.Singular;
import lombok.ToString; import lombok.ToString;
import lombok.extern.jackson.Jacksonized;
import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean; import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult; import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResultsButton;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
import java.util.List; import java.util.List;
@ -27,9 +29,10 @@ import java.util.regex.Pattern;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Jacksonized
@Builder @Builder
public class AnswerInlineQuery extends BotApiMethodBoolean { public class AnswerInlineQuery extends BotApiMethodBoolean {
public static final String PATH = "answerInlineQuery"; public static final String PATH = "answerInlineQuery";
@ -41,6 +44,7 @@ public class AnswerInlineQuery extends BotApiMethodBoolean {
private static final String NEXTOFFSET_FIELD = "next_offset"; private static final String NEXTOFFSET_FIELD = "next_offset";
private static final String SWITCH_PM_TEXT_FIELD = "switch_pm_text"; private static final String SWITCH_PM_TEXT_FIELD = "switch_pm_text";
private static final String SWITCH_PM_PARAMETER_FIELD = "switch_pm_parameter"; private static final String SWITCH_PM_PARAMETER_FIELD = "switch_pm_parameter";
private static final String BUTTON_FIELD = "button";
@JsonProperty(INLINEQUERYID_FIELD) @JsonProperty(INLINEQUERYID_FIELD)
@NonNull @NonNull
@ -55,19 +59,39 @@ public class AnswerInlineQuery extends BotApiMethodBoolean {
private Boolean isPersonal; ///< Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query private Boolean isPersonal; ///< Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query
@JsonProperty(NEXTOFFSET_FIELD) @JsonProperty(NEXTOFFSET_FIELD)
private String nextOffset; ///< Optional. Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you dont support pagination. Offset length cant exceed 64 bytes. private String nextOffset; ///< Optional. Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you dont support pagination. Offset length cant exceed 64 bytes.
/**
* Optional.
* If passed, clients will display a button with specified text that switches the user to a private chat with the
* bot and sends the bot a start message with the parameter switch_pm_parameter
*
* @deprecated Use {@link #setButton(InlineQueryResultsButton)}
*/
@JsonProperty(SWITCH_PM_TEXT_FIELD) @JsonProperty(SWITCH_PM_TEXT_FIELD)
private String switchPmText; ///< Optional. If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter @Deprecated
private String switchPmText;
/**
* Optional.
* Parameter for the start message sent to the bot when user presses the switch button
*
* @deprecated Use {@link #setButton(InlineQueryResultsButton)}
*/
@JsonProperty(SWITCH_PM_PARAMETER_FIELD) @JsonProperty(SWITCH_PM_PARAMETER_FIELD)
private String switchPmParameter; ///< Optional. Parameter for the start message sent to the bot when user presses the switch button @Deprecated
private String switchPmParameter;
/**
* Optional.
* A JSON serialized object describing a button to be shown above inline query results
*/
@JsonProperty(BUTTON_FIELD)
private InlineQueryResultsButton button;
@Override @Override
public void validate() throws TelegramApiValidationException { public void validate() throws TelegramApiValidationException {
if (inlineQueryId == null || inlineQueryId.isEmpty()) { if (inlineQueryId.isEmpty()) {
throw new TelegramApiValidationException("InlineQueryId can't be empty", this); throw new TelegramApiValidationException("InlineQueryId can't be empty", this);
} }
if (results == null) {
throw new TelegramApiValidationException("Results array can't be null", this);
}
if (switchPmText != null) { if (switchPmText != null) {
if (switchPmText.isEmpty()) { if (switchPmText.isEmpty()) {
throw new TelegramApiValidationException("SwitchPmText can't be empty", this); throw new TelegramApiValidationException("SwitchPmText can't be empty", this);
@ -85,6 +109,10 @@ public class AnswerInlineQuery extends BotApiMethodBoolean {
for (InlineQueryResult result : results) { for (InlineQueryResult result : results) {
result.validate(); result.validate();
} }
if (button != null) {
button.validate();
}
} }
@Override @Override

View File

@ -28,7 +28,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -30,7 +30,7 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -35,7 +35,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class CopyMessage extends BotApiMethod<MessageId> { public class CopyMessage extends BotApiMethod<MessageId> {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GetFile extends BotApiMethod<File> { public class GetFile extends BotApiMethod<File> {

View File

@ -22,7 +22,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -27,7 +27,7 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetPassportDataErrors extends BotApiMethodBoolean { public class SetPassportDataErrors extends BotApiMethodBoolean {

View File

@ -28,7 +28,7 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetMyCommands extends BotApiMethodBoolean { public class SetMyCommands extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class CloseForumTopic extends BotApiMethodBoolean { public class CloseForumTopic extends BotApiMethodBoolean {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class CloseGeneralForumTopic extends BotApiMethodBoolean { public class CloseGeneralForumTopic extends BotApiMethodBoolean {

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DeleteForumTopic extends BotApiMethodBoolean { public class DeleteForumTopic extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class EditForumTopic extends BotApiMethodBoolean { public class EditForumTopic extends BotApiMethodBoolean {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class EditGeneralForumTopic extends BotApiMethodBoolean { public class EditGeneralForumTopic extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class HideGeneralForumTopic extends BotApiMethodBoolean { public class HideGeneralForumTopic extends BotApiMethodBoolean {

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class ReopenForumTopic extends BotApiMethodBoolean { public class ReopenForumTopic extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class ReopenGeneralForumTopic extends BotApiMethodBoolean { public class ReopenGeneralForumTopic extends BotApiMethodBoolean {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class UnhideGeneralForumTopic extends BotApiMethodBoolean { public class UnhideGeneralForumTopic extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class UnpinAllForumTopicMessages extends BotApiMethodBoolean { public class UnpinAllForumTopicMessages extends BotApiMethodBoolean {

View File

@ -51,7 +51,7 @@ import java.util.ArrayList;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -48,7 +48,7 @@ import java.io.Serializable;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -24,7 +24,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@Builder @Builder
public class ApproveChatJoinRequest extends BotApiMethodBoolean { public class ApproveChatJoinRequest extends BotApiMethodBoolean {

View File

@ -34,7 +34,7 @@ import java.time.ZonedDateTime;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -32,7 +32,7 @@ import java.time.ZonedDateTime;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -30,7 +30,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@RequiredArgsConstructor @RequiredArgsConstructor
@Builder @Builder

View File

@ -24,7 +24,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@Builder @Builder
public class DeclineChatJoinRequest extends BotApiMethodBoolean { public class DeclineChatJoinRequest extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DeleteChatPhoto extends BotApiMethodBoolean { public class DeleteChatPhoto extends BotApiMethodBoolean {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DeleteChatStickerSet extends BotApiMethodBoolean { public class DeleteChatStickerSet extends BotApiMethodBoolean {

View File

@ -31,7 +31,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@RequiredArgsConstructor @RequiredArgsConstructor
@Builder @Builder

View File

@ -32,7 +32,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class ExportChatInviteLink extends BotApiMethod<String> { public class ExportChatInviteLink extends BotApiMethod<String> {

View File

@ -24,7 +24,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GetChat extends BotApiMethod<Chat> { public class GetChat extends BotApiMethod<Chat> {

View File

@ -30,7 +30,7 @@ import java.util.ArrayList;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GetChatAdministrators extends BotApiMethod<ArrayList<ChatMember>> { public class GetChatAdministrators extends BotApiMethod<ArrayList<ChatMember>> {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GetChatMember extends BotApiMethod<ChatMember> { public class GetChatMember extends BotApiMethod<ChatMember> {

View File

@ -23,7 +23,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GetChatMemberCount extends BotApiMethod<Integer> { public class GetChatMemberCount extends BotApiMethod<Integer> {

View File

@ -22,7 +22,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class LeaveChat extends BotApiMethodBoolean { public class LeaveChat extends BotApiMethodBoolean {

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class PromoteChatMember extends BotApiMethodBoolean { public class PromoteChatMember extends BotApiMethodBoolean {

View File

@ -33,7 +33,7 @@ import java.time.ZonedDateTime;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -32,7 +32,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class RevokeChatInviteLink extends BotApiMethod<ChatInviteLink> { public class RevokeChatInviteLink extends BotApiMethod<ChatInviteLink> {

View File

@ -23,7 +23,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetChatAdministratorCustomTitle extends BotApiMethodBoolean { public class SetChatAdministratorCustomTitle extends BotApiMethodBoolean {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@RequiredArgsConstructor @RequiredArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetChatPermissions extends BotApiMethodBoolean { public class SetChatPermissions extends BotApiMethodBoolean {

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetChatPhoto extends PartialBotApiMethod<Boolean> { public class SetChatPhoto extends PartialBotApiMethod<Boolean> {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetChatStickerSet extends BotApiMethodBoolean { public class SetChatStickerSet extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetChatTitle extends BotApiMethodBoolean { public class SetChatTitle extends BotApiMethodBoolean {

View File

@ -31,7 +31,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class UnbanChatMember extends BotApiMethodBoolean { public class UnbanChatMember extends BotApiMethodBoolean {

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class UnbanChatSenderChat extends BotApiMethodBoolean { public class UnbanChatSenderChat extends BotApiMethodBoolean {

View File

@ -30,7 +30,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class CreateInvoiceLink extends BotApiMethod<String> { public class CreateInvoiceLink extends BotApiMethod<String> {

View File

@ -30,7 +30,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendInvoice extends BotApiMethodMessage { public class SendInvoice extends BotApiMethodMessage {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetChatMenuButton extends BotApiMethodBoolean { public class SetChatMenuButton extends BotApiMethodBoolean {

View File

@ -0,0 +1,50 @@
package org.telegram.telegrambots.meta.api.methods.name;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.telegram.telegrambots.meta.api.methods.BotApiMethod;
import org.telegram.telegrambots.meta.api.objects.name.BotName;
import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException;
/**
* @author Ruben Bermudez
* @version 6.7
* Use this method to get the current bot name for the given user language.
*
* Returns BotName on success.
*/
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GetMyName extends BotApiMethod<BotName> {
public static final String PATH = "getMyDescription";
private static final String LANGUAGE_CODE_FIELD = "language_code";
/**
* Optional
* A two-letter ISO 639-1 language code or an empty string
*/
@JsonProperty(LANGUAGE_CODE_FIELD)
private String languageCode;
@Override
public BotName deserializeResponse(String answer) throws TelegramApiRequestException {
return deserializeResponse(answer, BotName.class);
}
@Override
public String getMethod() {
return PATH;
}
}

View File

@ -0,0 +1,51 @@
package org.telegram.telegrambots.meta.api.methods.name;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean;
/**
* @author Ruben Bermudez
* @version 6.7
* Use this method to change the bot's name. Returns True on success.
*/
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SetMyName extends BotApiMethodBoolean {
public static final String PATH = "setMyName";
private static final String NAME_FIELD = "name";
private static final String LANGUAGE_CODE_FIELD = "language_code";
/**
* Optional
* New bot name; 0-64 characters.
* Pass an empty string to remove the dedicated name for the given language.
*/
@JsonProperty(NAME_FIELD)
private String name;
/**
* Optional
* A two-letter ISO 639-1 language code.
* If empty, the name will be shown to all users for whose language there is no dedicated name.
*/
@JsonProperty(LANGUAGE_CODE_FIELD)
private String languageCode;
@Override
public String getMethod() {
return PATH;
}
}

View File

@ -28,7 +28,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class PinChatMessage extends BotApiMethodBoolean { public class PinChatMessage extends BotApiMethodBoolean {

View File

@ -27,7 +27,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class UnpinAllChatMessages extends BotApiMethodBoolean { public class UnpinAllChatMessages extends BotApiMethodBoolean {

View File

@ -29,7 +29,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class UnpinChatMessage extends BotApiMethodBoolean { public class UnpinChatMessage extends BotApiMethodBoolean {

View File

@ -33,7 +33,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendPoll extends BotApiMethodMessage { public class SendPoll extends BotApiMethodMessage {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class StopPoll extends BotApiMethod<Poll> { public class StopPoll extends BotApiMethod<Poll> {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendChatAction extends BotApiMethodBoolean { public class SendChatAction extends BotApiMethodBoolean {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendContact extends BotApiMethodMessage { public class SendContact extends BotApiMethodMessage {

View File

@ -29,7 +29,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendDice extends BotApiMethodMessage { public class SendDice extends BotApiMethodMessage {

View File

@ -42,7 +42,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendGame extends BotApiMethodMessage { public class SendGame extends BotApiMethodMessage {

View File

@ -32,7 +32,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@Deprecated @Deprecated

View File

@ -25,7 +25,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendLocation extends BotApiMethodMessage { public class SendLocation extends BotApiMethodMessage {

View File

@ -36,7 +36,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendMediaGroup extends PartialBotApiMethod<ArrayList<Message>> { public class SendMediaGroup extends PartialBotApiMethod<ArrayList<Message>> {

View File

@ -31,7 +31,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendMessage extends BotApiMethodMessage { public class SendMessage extends BotApiMethodMessage {

View File

@ -31,7 +31,7 @@ import java.util.Objects;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendPhoto extends SendMediaBotMethod<Message> { public class SendPhoto extends SendMediaBotMethod<Message> {

View File

@ -26,7 +26,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendVenue extends BotApiMethodMessage { public class SendVenue extends BotApiMethodMessage {

View File

@ -32,7 +32,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SendVoice extends SendMediaBotMethod<Message> { public class SendVoice extends SendMediaBotMethod<Message> {

View File

@ -21,7 +21,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DeleteStickerFromSet extends BotApiMethodBoolean { public class DeleteStickerFromSet extends BotApiMethodBoolean {

View File

@ -1,10 +1,15 @@
package org.telegram.telegrambots.meta.api.methods.stickers; package org.telegram.telegrambots.meta.api.methods.stickers;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Singular;
import lombok.ToString;
import org.telegram.telegrambots.meta.api.methods.BotApiMethod; import org.telegram.telegrambots.meta.api.methods.BotApiMethod;
import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean;
import org.telegram.telegrambots.meta.api.objects.games.GameHighScore;
import org.telegram.telegrambots.meta.api.objects.stickers.Sticker; import org.telegram.telegrambots.meta.api.objects.stickers.Sticker;
import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

View File

@ -23,7 +23,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class GetStickerSet extends BotApiMethod<StickerSet> { public class GetStickerSet extends BotApiMethod<StickerSet> {

View File

@ -33,7 +33,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class SetWebhook extends BotApiMethodBoolean { public class SetWebhook extends BotApiMethodBoolean {

View File

@ -31,7 +31,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class DeleteMessage extends BotApiMethodBoolean { public class DeleteMessage extends BotApiMethodBoolean {

View File

@ -29,7 +29,7 @@ import java.io.Serializable;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class EditMessageLiveLocation extends BotApiMethodSerializable { public class EditMessageLiveLocation extends BotApiMethodSerializable {

View File

@ -38,7 +38,7 @@ import java.io.Serializable;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class EditMessageMedia extends PartialBotApiMethod<Serializable> { public class EditMessageMedia extends PartialBotApiMethod<Serializable> {

View File

@ -33,7 +33,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class EditMessageText extends BotApiMethodSerializable { public class EditMessageText extends BotApiMethodSerializable {

View File

@ -29,7 +29,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class AnswerWebAppQuery extends BotApiMethod<SentWebAppMessage> { public class AnswerWebAppQuery extends BotApiMethod<SentWebAppMessage> {

View File

@ -25,7 +25,7 @@ import java.util.List;
@Setter @Setter
@ToString @ToString
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
@AllArgsConstructor @AllArgsConstructor
public class Chat implements BotApiObject { public class Chat implements BotApiObject {

View File

@ -25,9 +25,10 @@ public class ChatMemberUpdated implements BotApiObject {
private static final String CHAT_FIELD = "chat"; private static final String CHAT_FIELD = "chat";
private static final String FROM_FIELD = "from"; private static final String FROM_FIELD = "from";
private static final String DATE_FIELD = "date"; private static final String DATE_FIELD = "date";
private static final String OLDCHATMEMBER_FIELD = "old_chat_member"; private static final String OLD_CHAT_MEMBER_FIELD = "old_chat_member";
private static final String NEWCHATMEMBER_FIELD = "new_chat_member"; private static final String NEW_CHAT_MEMBER_FIELD = "new_chat_member";
private static final String INVITELINK_FIELD = "invite_link"; private static final String INVITE_LINK_FIELD = "invite_link";
private static final String VIA_CHAT_FOLDER_INVITE_LINK_FIELD = "via_chat_folder_invite_link";
/** /**
* Chat the user belongs to * Chat the user belongs to
@ -47,18 +48,25 @@ public class ChatMemberUpdated implements BotApiObject {
/** /**
* Previous information about the chat member * Previous information about the chat member
*/ */
@JsonProperty(OLDCHATMEMBER_FIELD) @JsonProperty(OLD_CHAT_MEMBER_FIELD)
private ChatMember oldChatMember; private ChatMember oldChatMember;
/** /**
* New information about the chat member * New information about the chat member
*/ */
@JsonProperty(NEWCHATMEMBER_FIELD) @JsonProperty(NEW_CHAT_MEMBER_FIELD)
private ChatMember newChatMember; private ChatMember newChatMember;
/** /**
* Optional. * Optional.
* Chat invite link, which was used by the user to join the chat; for joining by invite link events only. * Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
*/ */
@JsonProperty(INVITELINK_FIELD) @JsonProperty(INVITE_LINK_FIELD)
private ChatInviteLink inviteLink; private ChatInviteLink inviteLink;
/**
* Optional.
* True, if the user joined the chat via a chat folder invite link
*/
@JsonProperty(VIA_CHAT_FOLDER_INVITE_LINK_FIELD)
private Boolean viaChatFolderInviteLink;
} }

View File

@ -20,7 +20,7 @@ import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
@Setter @Setter
@ToString @ToString
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor(force = true)
public class Location implements BotApiObject { public class Location implements BotApiObject {
private static final String LONGITUDE_FIELD = "longitude"; private static final String LONGITUDE_FIELD = "longitude";

Some files were not shown because too many files have changed in this diff Show More