diff --git a/TelegramBots.wiki/Changelog.md b/TelegramBots.wiki/Changelog.md
index de57c861..bfb0bf44 100644
--- a/TelegramBots.wiki/Changelog.md
+++ b/TelegramBots.wiki/Changelog.md
@@ -8,4 +8,13 @@
7. In `SentCallback` method `onError` changed second parameter to `TelegramApiRequestException` and `onResult` now receives the deserialized answer (of type `T`) instead of a `JSONObject` as second parameter
8. Moved to MIT license
-**[[How to update to version 2.4.3|How-To-Update#2.4.3]]**
\ No newline at end of file
+**[[How to update to version 2.4.3|How-To-Update#2.4.3]]**
+
+### 2.4.4 ###
+1. Added `cache_time` to ÀnswerCallbackQuery method
+2. Added field `forward_from_message_id` to `Message` object
+3. Renamed `ReplyKeyboardHide` to `ReplyKeyboardRemove` and its field `hide_keyboard` to `remove_keyboard`
+4. Added field `force` and `disable_edit_message` to `SetGameScore`, removed `edit_message` one.
+5. Added `channel_post` and `edited_channel_post` to `Update` object.
+
+**[[How to update to version 2.4.4|How-To-Update#2.4.4]]**
\ No newline at end of file
diff --git a/TelegramBots.wiki/How-To-Update.md b/TelegramBots.wiki/How-To-Update.md
index 4a745d69..0cd2c929 100644
--- a/TelegramBots.wiki/How-To-Update.md
+++ b/TelegramBots.wiki/How-To-Update.md
@@ -8,4 +8,10 @@
3. **Deprecated** (will be removed in next version):
* `org.telegram.telegrambots.bots.BotOptions`. Use `org.telegram.telegrambots.bots.DefaultBotOptions` instead.
* `getPersonal` from `AnswerInlineQuery`. Use `isPersonal` instead.
- * `FILEBASEURL` from `File`. Use `getFileUrl` instead.
\ No newline at end of file
+ * `FILEBASEURL` from `File`. Use `getFileUrl` instead.
+
+
+### To version 2.4.4 ###
+1. Replace `ReplyKeyboardHide` by `ReplyKeyboardRemove` and its field `hideKeyboard` by `removeKeyboard` (remember getter and setters)
+2. Replace usage of `edit_message` by `disable_edit_message` (see [this post](https://telegram.me/BotNews/22))
+3. Removed deprecated stuff from version 2.4.3
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index c0590f52..97c9fbcf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
org.telegram
Bots
pom
- 2.4.3
+ 2.4.4
telegrambots
@@ -24,6 +24,6 @@
true
- 2.4.3
+ 2.4.4
\ No newline at end of file
diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml
index f1c9e77c..5df2fd0a 100644
--- a/telegrambots-meta/pom.xml
+++ b/telegrambots-meta/pom.xml
@@ -5,7 +5,7 @@
4.0.0
org.telegram
telegrambots-meta
- 2.4.3
+ 2.4.4
jar
Telegram Bots Meta
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerCallbackQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerCallbackQuery.java
index 59390331..bff2cf55 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerCallbackQuery.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerCallbackQuery.java
@@ -28,6 +28,7 @@ public class AnswerCallbackQuery extends BotApiMethod {
private static final String TEXT_FIELD = "text";
private static final String SHOWALERT_FIELD = "show_alert";
private static final String URL_FIELD = "url";
+ private static final String CACHETIME_FIELD = "cache_time";
@JsonProperty(CALLBACKQUERYID_FIELD)
private String callbackQueryId; ///< Unique identifier for the query to be answered
@@ -35,14 +36,22 @@ public class AnswerCallbackQuery extends BotApiMethod {
private String text; ///< Optional Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
@JsonProperty(SHOWALERT_FIELD)
private Boolean showAlert; ///< Optional. If true, an alert will be shown by the client instead of a notificaiton at the top of the chat screen. Defaults to false.
+ @JsonProperty(URL_FIELD)
/**
* Optional. URL that will be opened by the user's client.
* If you have created a Game and accepted the conditions via @Botfather,
* specify the URL that opens your game. Otherwise you may use links
* InlineQueryResultGamelike telegram.me/your_bot?start=XXXX that open your bot with a parameter.
*/
- @JsonProperty(URL_FIELD)
private String url;
+ @JsonProperty(CACHETIME_FIELD)
+ /**
+ * Optional The maximum amount of time in seconds that the result of the callback query
+ * may be cached client-side.
+ *
+ * @note Telegram apps will support caching starting in version 3.14. Defaults to 0.
+ */
+ private Integer cacheTime;
public AnswerCallbackQuery() {
super();
@@ -84,6 +93,14 @@ public class AnswerCallbackQuery extends BotApiMethod {
return this;
}
+ public Integer getCacheTime() {
+ return cacheTime;
+ }
+
+ public void setCacheTime(Integer cacheTime) {
+ this.cacheTime = cacheTime;
+ }
+
@Override
public String getMethod() {
return PATH;
@@ -118,6 +135,7 @@ public class AnswerCallbackQuery extends BotApiMethod {
", text='" + text + '\'' +
", showAlert=" + showAlert +
", url='" + url + '\'' +
+ ", cacheTime=" + cacheTime +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerInlineQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerInlineQuery.java
index 115202e9..5f4e3572 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerInlineQuery.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/AnswerInlineQuery.java
@@ -81,12 +81,6 @@ public class AnswerInlineQuery extends BotApiMethod {
return this;
}
- @Deprecated
- @JsonIgnore
- public Boolean getPersonal() {
- return isPersonal;
- }
-
public Boolean isPersonal() {
return isPersonal;
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/games/SetGameScore.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/games/SetGameScore.java
index 43b6276f..daa06841 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/games/SetGameScore.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/games/SetGameScore.java
@@ -33,12 +33,12 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 2.4
- * @brief Use this method to set the score of the specified user in a game.
+ * Use this method to set the score of the specified user in a game.
* On success, if the message was sent by the bot, returns the edited Message,
* otherwise returns True.
- * If the new score is not greater than the user's current score in the chat,
- * returns an error with the description “BOT_SCORE_NOT_MODIFIED”.
- * @date 16 of September of 2016
+ *
+ * Returns an error, if the new score is not greater than the user's current score in
+ * the chat and force is False.
*/
public class SetGameScore extends BotApiMethod {
public static final String PATH = "setGameScore";
@@ -48,7 +48,8 @@ public class SetGameScore extends BotApiMethod {
private static final String CHATID_FIELD = "chat_id";
private static final String MESSAGEID_FIELD = "message_id";
private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id";
- private static final String EDIT_MESSAGE_FIELD = "edit_message";
+ private static final String DISABLEEDITMESSAGE_FIELD = "disable_edit_message";
+ private static final String FORCE_FIELD = "force";
@JsonProperty(CHATID_FIELD)
private String chatId; ///< Optional Required if inline_message_id is not specified. Unique identifier for the target chat (or username of the target channel in the format @channelusername)
@@ -56,12 +57,14 @@ public class SetGameScore extends BotApiMethod {
private Integer messageId; ///< Optional Required if inline_message_id is not specified. Unique identifier of the sent message
@JsonProperty(INLINE_MESSAGE_ID_FIELD)
private String inlineMessageId; ///< Optional Required if chat_id and message_id are not specified. Identifier of the inline message
- @JsonProperty(EDIT_MESSAGE_FIELD)
- private Boolean editMessage; ///< Optional Pass True, if the message should be edited to include the current scoreboard
+ @JsonProperty(DISABLEEDITMESSAGE_FIELD)
+ private Boolean disableEditMessage; ///< Optional Pass True, if the game message should not be automatically edited to include the current scoreboard. Defaults to False
@JsonProperty(USER_ID_FIELD)
private Integer userId; ///< User identifier
@JsonProperty(SCORE_FIELD)
private Integer score; ///< New score, must be positive
+ @JsonProperty(FORCE_FIELD)
+ private Boolean force; ///< Opfional. Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
public SetGameScore() {
super();
@@ -79,8 +82,8 @@ public class SetGameScore extends BotApiMethod {
return inlineMessageId;
}
- public Boolean getEditMessage() {
- return editMessage;
+ public Boolean getDisableEditMessage() {
+ return disableEditMessage;
}
public Integer getUserId() {
@@ -91,6 +94,10 @@ public class SetGameScore extends BotApiMethod {
return score;
}
+ public Boolean getForce() {
+ return force;
+ }
+
public SetGameScore setChatId(String chatId) {
this.chatId = chatId;
return this;
@@ -112,8 +119,8 @@ public class SetGameScore extends BotApiMethod {
return this;
}
- public SetGameScore setEditMessage(Boolean editMessage) {
- this.editMessage = editMessage;
+ public SetGameScore setDisableEditMessage(Boolean disableEditMessage) {
+ this.disableEditMessage = disableEditMessage;
return this;
}
@@ -127,6 +134,11 @@ public class SetGameScore extends BotApiMethod {
return this;
}
+ public SetGameScore setForce(Boolean force) {
+ this.force = force;
+ return this;
+ }
+
@Override
public String getMethod() {
return PATH;
@@ -189,9 +201,10 @@ public class SetGameScore extends BotApiMethod {
"chatId='" + chatId + '\'' +
", messageId=" + messageId +
", inlineMessageId='" + inlineMessageId + '\'' +
- ", editMessage=" + editMessage +
+ ", disableEditMessage=" + disableEditMessage +
", userId=" + userId +
", score=" + score +
+ ", force=" + force +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/File.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/File.java
index b5f76228..290f6e5a 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/File.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/File.java
@@ -1,6 +1,5 @@
package org.telegram.telegrambots.api.objects;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.api.interfaces.BotApiObject;
@@ -15,14 +14,6 @@ import java.text.MessageFormat;
* @date 24 of June of 2015
*/
public class File implements BotApiObject {
- @JsonIgnore
- /**
- * @deprecated It is still public for backward compatibility, will be removed in next big release.
- * use {@link #getFileUrl(String, String)} or {@link #getFileUrl(String)} instead.
- */
- @Deprecated
- public static final String FILEBASEURL = "https://api.telegram.org/file/bot{0}/{1}";
-
private static final String FILE_ID = "file_id";
private static final String FILE_SIZE_FIELD = "file_size";
private static final String FILE_PATH_FIELD = "file_path";
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java
index c8c028c3..1c90f1c4 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java
@@ -47,6 +47,7 @@ public class Message implements BotApiObject {
private static final String MIGRATEFROMCHAT_FIELD = "migrate_from_chat_id";
private static final String EDITDATE_FIELD = "edit_date";
private static final String GAME_FIELD = "game";
+ private static final String FORWARDFROMMESSAGEID_FIELD = "forward_from_message_id";
@JsonProperty(MESSAGEID_FIELD)
private Integer messageId; ///< Integer Unique message identifier
@@ -146,6 +147,8 @@ public class Message implements BotApiObject {
private Integer editDate; ///< Optional. Date the message was last edited in Unix time
@JsonProperty(GAME_FIELD)
private Game game; ///< Optional. Message is a game, information about the game
+ @JsonProperty(FORWARDFROMMESSAGEID_FIELD)
+ private Integer forwardFromMessageId; ///< Optional. For forwarded channel posts, identifier of the original message in the channel
public Message() {
super();
@@ -272,6 +275,10 @@ public class Message implements BotApiObject {
return migrateFromChatId;
}
+ public Integer getForwardFromMessageId() {
+ return forwardFromMessageId;
+ }
+
public boolean isGroupMessage() {
return chat.isGroupChat();
}
@@ -380,6 +387,7 @@ public class Message implements BotApiObject {
", migrateFromChatId=" + migrateFromChatId +
", editDate=" + editDate +
", game=" + game +
+ ", forwardFromMessageId=" + forwardFromMessageId +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Update.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Update.java
index 241974aa..003caac5 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Update.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Update.java
@@ -20,6 +20,8 @@ public class Update implements BotApiObject {
private static final String CHOSENINLINEQUERY_FIELD = "chosen_inline_result";
private static final String CALLBACKQUERY_FIELD = "callback_query";
private static final String EDITEDMESSAGE_FIELD = "edited_message";
+ private static final String CHANNELPOST_FIELD = "channel_post";
+ private static final String EDITEDCHANNELPOST_FIELD = "edited_channel_post";
@JsonProperty(UPDATEID_FIELD)
private Integer updateId;
@@ -33,6 +35,11 @@ public class Update implements BotApiObject {
private CallbackQuery callbackQuery; ///< Optional. New incoming callback query
@JsonProperty(EDITEDMESSAGE_FIELD)
private Message editedMessage; ///< Optional. New version of a message that is known to the bot and was edited
+ @JsonProperty(CHANNELPOST_FIELD)
+ private Message channelPost; ///< Optional. New incoming channel post of any kind — text, photo, sticker, etc.
+ @JsonProperty(EDITEDCHANNELPOST_FIELD)
+ private Message editedChannelPost; ///< Optional. New version of a channel post that is known to the bot and was edited
+
public Update() {
super();
@@ -62,6 +69,14 @@ public class Update implements BotApiObject {
return editedMessage;
}
+ public Message getChannelPost() {
+ return channelPost;
+ }
+
+ public Message getEditedChannelPost() {
+ return editedChannelPost;
+ }
+
public boolean hasMessage() {
return message != null;
}
@@ -82,6 +97,14 @@ public class Update implements BotApiObject {
return editedMessage != null;
}
+ public boolean hasChannelPost() {
+ return channelPost != null;
+ }
+
+ public boolean hasEditedChannelPost() {
+ return editedChannelPost != null;
+ }
+
@Override
public String toString() {
return "Update{" +
@@ -91,6 +114,8 @@ public class Update implements BotApiObject {
", chosenInlineQuery=" + chosenInlineQuery +
", callbackQuery=" + callbackQuery +
", editedMessage=" + editedMessage +
+ ", channelPost=" + channelPost +
+ ", editedChannelPost=" + editedChannelPost +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/replykeyboard/ReplyKeyboardHide.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/replykeyboard/ReplyKeyboardRemove.java
similarity index 67%
rename from telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/replykeyboard/ReplyKeyboardHide.java
rename to telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/replykeyboard/ReplyKeyboardRemove.java
index 2de1247d..250106fa 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/replykeyboard/ReplyKeyboardHide.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/replykeyboard/ReplyKeyboardRemove.java
@@ -13,12 +13,12 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
* hidden immediately after the user presses a button (@see ReplyKeyboardMarkup).
* @date 20 of June of 2015
*/
-public class ReplyKeyboardHide implements ReplyKeyboard {
- private static final String HIDEKEYBOARD_FIELD = "hide_keyboard";
+public class ReplyKeyboardRemove implements ReplyKeyboard {
+ private static final String REMOVEKEYBOARD_FIELD = "remove_keyboard";
private static final String SELECTIVE_FIELD = "selective";
- @JsonProperty(HIDEKEYBOARD_FIELD)
- private Boolean hideKeyboard; ///< Requests clients to hide the custom keyboard
+ @JsonProperty(REMOVEKEYBOARD_FIELD)
+ private Boolean removeKeyboard; ///< Requests clients to remove the custom keyboard
/**
* Optional. Use this parameter if you want to show the keyboard to specific users only.
* Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's
@@ -27,35 +27,35 @@ public class ReplyKeyboardHide implements ReplyKeyboard {
@JsonProperty(SELECTIVE_FIELD)
private Boolean selective;
- public ReplyKeyboardHide() {
+ public ReplyKeyboardRemove() {
super();
- this.hideKeyboard = true;
+ this.removeKeyboard = true;
}
- public Boolean getHideKeyboard() {
- return hideKeyboard;
+ public Boolean getRemoveKeyboard() {
+ return removeKeyboard;
}
public Boolean getSelective() {
return selective;
}
- public ReplyKeyboardHide setSelective(Boolean selective) {
+ public ReplyKeyboardRemove setSelective(Boolean selective) {
this.selective = selective;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
- if (hideKeyboard == null) {
- throw new TelegramApiValidationException("Hidekeyboard parameter can't be null", this);
+ if (removeKeyboard == null) {
+ throw new TelegramApiValidationException("RemoveKeyboard parameter can't be null", this);
}
}
@Override
public String toString() {
- return "ReplyKeyboardHide{" +
- "hideKeyboard=" + hideKeyboard +
+ return "ReplyKeyboardRemove{" +
+ "removeKeyboard=" + removeKeyboard +
", selective=" + selective +
'}';
}
diff --git a/telegrambots-meta/src/test/java/org/telegram/telegrambots/apimethods/TestSetGameScore.java b/telegrambots-meta/src/test/java/org/telegram/telegrambots/apimethods/TestSetGameScore.java
index 3e82014d..6b7b64ae 100644
--- a/telegrambots-meta/src/test/java/org/telegram/telegrambots/apimethods/TestSetGameScore.java
+++ b/telegrambots-meta/src/test/java/org/telegram/telegrambots/apimethods/TestSetGameScore.java
@@ -24,7 +24,7 @@ public class TestSetGameScore {
public void setUp() throws Exception {
setGameScore = new SetGameScore();
setGameScore.setChatId("12345");
- setGameScore.setEditMessage(true);
+ setGameScore.setDisableEditMessage(true);
setGameScore.setMessageId(54321);
setGameScore.setScore(12);
setGameScore.setUserId(98765);
@@ -34,7 +34,7 @@ public class TestSetGameScore {
public void TestGetUpdatesMustBeSerializable() throws Exception {
String json = mapper.writeValueAsString(setGameScore);
Assert.assertNotNull(json);
- Assert.assertEquals("{\"chat_id\":\"12345\",\"message_id\":54321,\"edit_message\":true,\"user_id\":98765,\"score\":12,\"method\":\"setGameScore\"}", json);
+ Assert.assertEquals("{\"chat_id\":\"12345\",\"message_id\":54321,\"disable_edit_message\":true,\"user_id\":98765,\"score\":12,\"method\":\"setGameScore\"}", json);
}
@Test
diff --git a/telegrambots/pom.xml b/telegrambots/pom.xml
index a7f7e6a4..3cb9d444 100644
--- a/telegrambots/pom.xml
+++ b/telegrambots/pom.xml
@@ -5,7 +5,7 @@
4.0.0
org.telegram
telegrambots
- 2.4.3
+ 2.4.4
jar
Telegram Bots
@@ -65,7 +65,7 @@
20160810
2.8.5
2.5
- 2.4.3
+ 2.4.4
diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/BotOptions.java b/telegrambots/src/main/java/org/telegram/telegrambots/bots/BotOptions.java
deleted file mode 100644
index 73822506..00000000
--- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/BotOptions.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.telegram.telegrambots.bots;
-
-import org.apache.http.HttpHost;
-import org.apache.http.client.config.RequestConfig;
-import org.telegram.telegrambots.Constants;
-
-/**
- * @author Ruben Bermudez
- * @version 1.0
- * @deprecated Use {@link DefaultBotOptions} instead
- */
-@Deprecated
-public class BotOptions extends DefaultBotOptions {
- private String proxyHost;
- private int proxyPort;
-
- public boolean hasProxy() {
- return proxyHost != null && !proxyHost.isEmpty() && proxyPort > 0;
- }
-
- /**
- * @deprecated Use {@link #setRequestConfig(RequestConfig)} instead to configure custom request config
- * @param proxyHost Host for the proxy
- *
- * @apiNote This method will be removed in the future
- */
- public void setProxyHost(String proxyHost) {
- this.proxyHost = proxyHost;
- }
-
- /**
- * @deprecated Use {@link #setRequestConfig(RequestConfig)} instead to configure custom request config
- * @param proxyPort Port for the proxy
- *
- * @apiNote This method will be removed in the future
- */
- public void setProxyPort(int proxyPort) {
- this.proxyPort = proxyPort;
- }
-
- @Override
- public RequestConfig getRequestConfig() {
- if (super.getRequestConfig() == null) {
- if (hasProxy()) { // For backward compatibility
- return RequestConfig.copy(RequestConfig.custom().build())
- .setProxy(new HttpHost(proxyHost, proxyPort))
- .setSocketTimeout(Constants.SOCKET_TIMEOUT)
- .setConnectTimeout(Constants.SOCKET_TIMEOUT)
- .setConnectionRequestTimeout(Constants.SOCKET_TIMEOUT)
- .build();
- }
- return RequestConfig.copy(RequestConfig.custom().build())
- .setSocketTimeout(Constants.SOCKET_TIMEOUT)
- .setConnectTimeout(Constants.SOCKET_TIMEOUT)
- .setConnectionRequestTimeout(Constants.SOCKET_TIMEOUT)
- .build();
- }
-
- return super.getRequestConfig();
- }
-}
diff --git a/telegrambots/src/test/java/org/telegram/telegrambots/BotApiMethodHelperFactory.java b/telegrambots/src/test/java/org/telegram/telegrambots/BotApiMethodHelperFactory.java
index 19a2aadc..696d4ba8 100644
--- a/telegrambots/src/test/java/org/telegram/telegrambots/BotApiMethodHelperFactory.java
+++ b/telegrambots/src/test/java/org/telegram/telegrambots/BotApiMethodHelperFactory.java
@@ -279,7 +279,7 @@ public final class BotApiMethodHelperFactory {
public static BotApiMethod getSetGameScore() {
return new SetGameScore()
.setInlineMessageId("12345")
- .setEditMessage(true)
+ .setDisableEditMessage(true)
.setScore(12)
.setUserId(98765);
}
diff --git a/telegrambots/src/test/java/org/telegram/telegrambots/TestRestApi.java b/telegrambots/src/test/java/org/telegram/telegrambots/TestRestApi.java
index 4ae43859..30d6e81f 100644
--- a/telegrambots/src/test/java/org/telegram/telegrambots/TestRestApi.java
+++ b/telegrambots/src/test/java/org/telegram/telegrambots/TestRestApi.java
@@ -106,29 +106,7 @@ public class TestRestApi extends JerseyTest {
.request(MediaType.APPLICATION_JSON)
.post(entity, AnswerInlineQuery.class);
- assertEquals("{\"inline_query_id\":\"id\",\"results\":[{\"@class\":\"org." +
- "telegram.telegrambots.api.objects.inlinequery.result.InlineQueryResultArticle\"," +
- "\"type\":\"article\",\"id\":\"0\",\"title\":\"Title\",\"input_message_content\":{\"@class\":\"org." +
- "telegram.telegrambots.api.objects.inlinequery.inputmessagecontent." +
- "InputTextMessageContent\",\"message_text\":\"Text\",\"parse_mode\":\"Markdown\"}," +
- "\"reply_markup\":{\"@class\":\"org.telegram.telegrambots.api.objects.replykeyboard" +
- ".InlineKeyboardMarkup\",\"inline_keyboard\":[[{\"@class\":\"org.telegram." +
- "telegrambots.api.objects.replykeyboard.buttons.InlineKeyboardButton\",\"text\":" +
- "\"Button1\",\"callback_data\":\"Callback\"}]]},\"url\":\"Url\",\"hide_url\":false," +
- "\"description\":\"Description\",\"thumb_url\":\"ThumbUrl\",\"thumb_width\":10," +
- "\"thumb_height\":20},{\"@class\":\"org.telegram.telegrambots.api.objects." +
- "inlinequery.result.InlineQueryResultPhoto\",\"type\":\"photo\",\"id\":\"1\",\"photo_url\":\"PhotoUrl" +
- "\",\"mime_type\":\"image/jpg\",\"photo_width\":10,\"photo_height\":20,\"thumb_url" +
- "\":\"ThumbUrl\",\"title\":\"Title\",\"description\":\"Description\",\"caption\":" +
- "\"Caption\",\"input_message_content\":{\"@class\":\"org.telegram.telegrambots." +
- "api.objects.inlinequery.inputmessagecontent.InputTextMessageContent\",\"" +
- "message_text\":\"Text\",\"parse_mode\":\"Markdown\"},\"reply_markup\":{\"@class\":" +
- "\"org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup\"," +
- "\"inline_keyboard\":[[{\"@class\":\"org.telegram.telegrambots.api.objects." +
- "replykeyboard.buttons.InlineKeyboardButton\",\"text\":\"Button1\"," +
- "\"callback_data\":\"Callback\"}]]}}],\"cache_time\":100,\"is_personal\":true," +
- "\"next_offset\":\"3\",\"switch_pm_text\":\"pmText\",\"switch_pm_parameter\":" +
- "\"PmParameter\",\"method\":\"answerInlineQuery\"}", map(result));
+ assertEquals("{\"personal\":true,\"inline_query_id\":\"id\",\"results\":[{\"@class\":\"org.telegram.telegrambots.api.objects.inlinequery.result.InlineQueryResultArticle\",\"type\":\"article\",\"id\":\"0\",\"title\":\"Title\",\"input_message_content\":{\"@class\":\"org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputTextMessageContent\",\"message_text\":\"Text\",\"parse_mode\":\"Markdown\"},\"reply_markup\":{\"@class\":\"org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup\",\"inline_keyboard\":[[{\"@class\":\"org.telegram.telegrambots.api.objects.replykeyboard.buttons.InlineKeyboardButton\",\"text\":\"Button1\",\"callback_data\":\"Callback\"}]]},\"url\":\"Url\",\"hide_url\":false,\"description\":\"Description\",\"thumb_url\":\"ThumbUrl\",\"thumb_width\":10,\"thumb_height\":20},{\"@class\":\"org.telegram.telegrambots.api.objects.inlinequery.result.InlineQueryResultPhoto\",\"type\":\"photo\",\"id\":\"1\",\"photo_url\":\"PhotoUrl\",\"mime_type\":\"image/jpg\",\"photo_width\":10,\"photo_height\":20,\"thumb_url\":\"ThumbUrl\",\"title\":\"Title\",\"description\":\"Description\",\"caption\":\"Caption\",\"input_message_content\":{\"@class\":\"org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputTextMessageContent\",\"message_text\":\"Text\",\"parse_mode\":\"Markdown\"},\"reply_markup\":{\"@class\":\"org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup\",\"inline_keyboard\":[[{\"@class\":\"org.telegram.telegrambots.api.objects.replykeyboard.buttons.InlineKeyboardButton\",\"text\":\"Button1\",\"callback_data\":\"Callback\"}]]}}],\"cache_time\":100,\"is_personal\":true,\"next_offset\":\"3\",\"switch_pm_text\":\"pmText\",\"switch_pm_parameter\":\"PmParameter\",\"method\":\"answerInlineQuery\"}", map(result));
}
@Test
@@ -417,7 +395,7 @@ public class TestRestApi extends JerseyTest {
.request(MediaType.APPLICATION_JSON)
.post(entity, SetGameScore.class);
- assertEquals("{\"inline_message_id\":\"12345\",\"edit_message\":true,\"user_id\":98765,\"score\":12,\"method\":\"setGameScore\"}", map(result));
+ assertEquals("{\"inline_message_id\":\"12345\",\"disable_edit_message\":true,\"user_id\":98765,\"score\":12,\"method\":\"setGameScore\"}", map(result));
}
@Test