Skip to content

Commit c4394aa

Browse files
committed
Fix #1275
1 parent 0c82af2 commit c4394aa

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/games/CallbackGame.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import lombok.Setter;
2424
import lombok.ToString;
2525
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
26+
import org.telegram.telegrambots.meta.api.interfaces.Validable;
2627

2728
/**
2829
* @author Ruben Bermudez
@@ -34,5 +35,5 @@
3435
@Setter
3536
@ToString
3637
@NoArgsConstructor
37-
public class CallbackGame implements BotApiObject {
38+
public class CallbackGame implements BotApiObject, Validable {
3839
}

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/InlineKeyboardButton.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class InlineKeyboardButton implements Validable, BotApiObject {
4343
private static final String CALLBACK_GAME_FIELD = "callback_game";
4444
private static final String SWITCH_INLINE_QUERY_FIELD = "switch_inline_query";
4545
private static final String SWITCH_INLINE_QUERY_CURRENT_CHAT_FIELD = "switch_inline_query_current_chat";
46+
private static final String SWITCH_INLINE_QUERY_CHOSEN_CHAT_FIELD = "switch_inline_query_chosen_chat";
4647
private static final String PAY_FIELD = "pay";
4748
private static final String LOGIN_URL_FIELD = "login_url";
4849
private static final String WEBAPP_FIELD = "web_app";
@@ -102,7 +103,6 @@ public class InlineKeyboardButton implements Validable, BotApiObject {
102103
*/
103104
@JsonProperty(LOGIN_URL_FIELD)
104105
private LoginUrl loginUrl;
105-
106106
/**
107107
* Optional.
108108
* Description of the web app that will be launched when the user presses the button.
@@ -111,6 +111,14 @@ public class InlineKeyboardButton implements Validable, BotApiObject {
111111
*/
112112
@JsonProperty(WEBAPP_FIELD)
113113
private WebAppInfo webApp;
114+
/**
115+
* Optional.
116+
* If set, pressing the button will prompt the user to select one of their chats of the specified type,
117+
* open that chat and insert the bot's username and the specified inline query in the input field
118+
*/
119+
@JsonProperty(SWITCH_INLINE_QUERY_CHOSEN_CHAT_FIELD)
120+
private SwitchInlineQueryChosenChat switchInlineQueryChosenChat;
121+
114122

115123
@Override
116124
public void validate() throws TelegramApiValidationException {
@@ -123,5 +131,11 @@ public void validate() throws TelegramApiValidationException {
123131
if (webApp != null) {
124132
webApp.validate();
125133
}
134+
if (callbackGame != null) {
135+
callbackGame.validate();
136+
}
137+
if (switchInlineQueryChosenChat != null) {
138+
switchInlineQueryChosenChat.validate();
139+
}
126140
}
127141
}

0 commit comments

Comments
 (0)