From 7409a046313a40d746398682f03617073f3602ca Mon Sep 17 00:00:00 2001
From: Cadiducho
Date: Wed, 21 Aug 2019 16:22:11 +0200
Subject: [PATCH] Telegram Bot API 4.4
---
pom.xml | 6 +++---
.../com/cadiducho/telegrambotapi/BotAPI.java | 6 +++---
.../handlers/ExponentialBackOff.java | 16 +++++++++++++---
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/pom.xml b/pom.xml
index 16dbdad..2378abe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.cadiducho
TelegramBotAPI
- 4.4-SNAPSHOT
+ 4.4
jar
UTF-8
@@ -34,7 +34,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 2.9
+ 3.1.1
attach-javadocs
@@ -49,7 +49,7 @@
maven-surefire-plugin
- 2.22.0
+ 3.0.0-M3
diff --git a/src/main/java/com/cadiducho/telegrambotapi/BotAPI.java b/src/main/java/com/cadiducho/telegrambotapi/BotAPI.java
index b390dc1..63bcee4 100644
--- a/src/main/java/com/cadiducho/telegrambotapi/BotAPI.java
+++ b/src/main/java/com/cadiducho/telegrambotapi/BotAPI.java
@@ -323,7 +323,7 @@ default Message sendAnimation(Object chat_id, java.io.File animation) throws Tel
* @param duration Duration of the animation in seconds
* @param width Animation width
* @param height Animation height
- * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://\” if the thumbnail was uploaded using multipart/form-data under \.
+ * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
* @param caption Animation caption (may also be used when resending videos by file_id), 0-1024 characters
* @param parse_mode Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
* @param disable_notification Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
@@ -764,8 +764,8 @@ Boolean promoteChatMember(Object chat_id, Integer user_id, Boolean can_change_in
* The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights.
* @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
* @param permissions New default chat permissions
- * @return
- * @throws TelegramException
+ * @return On success, True is returned.
+ * @throws com.cadiducho.telegrambotapi.exception.TelegramException if the method fails in Telegram servers
*/
Boolean setChatPermissions(Object chat_id, ChatPermissions permissions) throws TelegramException;
diff --git a/src/main/java/com/cadiducho/telegrambotapi/handlers/ExponentialBackOff.java b/src/main/java/com/cadiducho/telegrambotapi/handlers/ExponentialBackOff.java
index 97c08b4..d4ace0f 100644
--- a/src/main/java/com/cadiducho/telegrambotapi/handlers/ExponentialBackOff.java
+++ b/src/main/java/com/cadiducho/telegrambotapi/handlers/ExponentialBackOff.java
@@ -172,6 +172,7 @@ public final void reset() {
*
* Subclasses may override if a different algorithm is required.
*
+ * @return next back off millis
*/
public long nextBackOffMillis() {
// Make sure we have not gone over the maximum elapsed time.
@@ -200,7 +201,10 @@ static int getRandomValueFromInterval(
return randomValue;
}
- /** Returns the initial retry interval in milliseconds. */
+ /**
+ * Returns the initial retry interval in milliseconds.
+ * @return the initial retry interval in milliseconds.
+ */
public final int getInitialIntervalMillis() {
return initialIntervalMillis;
}
@@ -212,6 +216,7 @@ public final int getInitialIntervalMillis() {
* A randomization factor of 0.5 results in a random period ranging between 50% below and 50%
* above the retry interval.
*
+ * @return the randomization factor
*/
public final double getRandomizationFactor() {
return randomizationFactor;
@@ -219,6 +224,7 @@ public final double getRandomizationFactor() {
/**
* Returns the current retry interval in milliseconds.
+ * @return the current retry interval in milliseconds.
*/
public final int getCurrentIntervalMillis() {
return currentIntervalMillis;
@@ -226,14 +232,16 @@ public final int getCurrentIntervalMillis() {
/**
* Returns the value to multiply the current interval with for each retry attempt.
+ * @return the value to multiply the current interval
*/
public final double getMultiplier() {
return multiplier;
}
/**
- * Returns the maximum value of the back off period in milliseconds. Once the current interval
- * reaches this value it stops increasing.
+ * Returns the maximum value of the back off period in milliseconds.
+ * Once the current interval reaches this value it stops increasing.
+ * @return the maximum value of the back off period in milliseconds
*/
public final int getMaxIntervalMillis() {
return maxIntervalMillis;
@@ -247,6 +255,7 @@ public final int getMaxIntervalMillis() {
* max_elapsed_time then the method {@link #nextBackOffMillis()} starts returning
* this value. The elapsed time can be reset by calling {@link #reset()}.
*
+ * @return the maximum elapsed time in milliseconds
*/
public final int getMaxElapsedTimeMillis() {
return maxElapsedTimeMillis;
@@ -259,6 +268,7 @@ public final int getMaxElapsedTimeMillis() {
*
* The elapsed time is computed using {@link System#nanoTime()}.
*
+ * @return the elapsed time in milliseconds
*/
public final long getElapsedTimeMillis() {
return (nanoTime() - startTimeNanos) / 1000000;