Skip to content

Commit a04b06f

Browse files
committed
Added the field switch_inline_query_chosen_chat of the type SwitchInlineQueryChosenChat to the class InlineKeyboardButton,
1 parent 67e212a commit a04b06f

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

library/src/main/java/com/pengrad/telegrambot/model/request/InlineKeyboardButton.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class InlineKeyboardButton implements Serializable {
1818
private String callback_data;
1919
private String switch_inline_query;
2020
private String switch_inline_query_current_chat;
21+
private SwitchInlineQueryChosenChat switch_inline_query_chosen_chat;
2122
private CallbackGame callback_game;
2223
private Boolean pay;
2324
private WebAppInfo web_app;
@@ -56,6 +57,11 @@ public InlineKeyboardButton switchInlineQueryCurrentChat(String switchInlineQuer
5657
return this;
5758
}
5859

60+
public InlineKeyboardButton switchInlineQueryChosenChat(SwitchInlineQueryChosenChat switchInlineQueryChosenChat) {
61+
switch_inline_query_chosen_chat = switchInlineQueryChosenChat;
62+
return this;
63+
}
64+
5965
public InlineKeyboardButton callbackGame(String callbackGame) {
6066
callback_game = new CallbackGame();
6167
return this;
@@ -91,6 +97,10 @@ public String switchInlineQueryCurrentChat() {
9197
return switch_inline_query_current_chat;
9298
}
9399

100+
public SwitchInlineQueryChosenChat switchInlineQueryChosenChat() {
101+
return switch_inline_query_chosen_chat;
102+
}
103+
94104
public CallbackGame callbackGame() {
95105
return callback_game;
96106
}
@@ -114,14 +124,15 @@ public boolean equals(Object o) {
114124
Objects.equals(callback_data, that.callback_data) &&
115125
Objects.equals(switch_inline_query, that.switch_inline_query) &&
116126
Objects.equals(switch_inline_query_current_chat, that.switch_inline_query_current_chat) &&
127+
Objects.equals(switch_inline_query_chosen_chat, that.switch_inline_query_chosen_chat) &&
117128
Objects.equals(callback_game, that.callback_game) &&
118129
Objects.equals(pay, that.pay) &&
119130
Objects.equals(web_app, that.web_app);
120131
}
121132

122133
@Override
123134
public int hashCode() {
124-
return Objects.hash(text, url, login_url, callback_data, switch_inline_query, switch_inline_query_current_chat, callback_game, pay, web_app);
135+
return Objects.hash(text, url, login_url, callback_data, switch_inline_query, switch_inline_query_current_chat, switch_inline_query_chosen_chat, callback_game, pay, web_app);
125136
}
126137

127138
@Override
@@ -133,6 +144,7 @@ public String toString() {
133144
", callback_data='" + callback_data + '\'' +
134145
", switch_inline_query='" + switch_inline_query + '\'' +
135146
", switch_inline_query_current_chat='" + switch_inline_query_current_chat + '\'' +
147+
", switch_inline_query_chosen_chat='" + switch_inline_query_chosen_chat + '\'' +
136148
", callback_game=" + callback_game +
137149
", pay=" + pay +
138150
", web_app=" + web_app +
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.pengrad.telegrambot.model.request;
2+
3+
import java.io.Serializable;
4+
import java.util.Objects;
5+
6+
public class SwitchInlineQueryChosenChat implements Serializable {
7+
private final static long serialVersionUID = 0L;
8+
9+
private String query;
10+
private Boolean allow_user_chats;
11+
private Boolean allow_bot_chats;
12+
private Boolean allow_group_chats;
13+
private Boolean allow_channel_chats;
14+
15+
public SwitchInlineQueryChosenChat query(String query) {
16+
this.query = query;
17+
return this;
18+
}
19+
20+
public SwitchInlineQueryChosenChat allowUserChats(Boolean allowUserChats) {
21+
this.allow_user_chats = allowUserChats;
22+
return this;
23+
}
24+
25+
public SwitchInlineQueryChosenChat allowBotChats(Boolean allowBotChats) {
26+
this.allow_bot_chats = allowBotChats;
27+
return this;
28+
}
29+
30+
public SwitchInlineQueryChosenChat allowGroupChats(Boolean allowGroupChats) {
31+
this.allow_group_chats = allowGroupChats;
32+
return this;
33+
}
34+
35+
public SwitchInlineQueryChosenChat allowChannelChats(Boolean allowChannelChats) {
36+
this.allow_channel_chats = allowChannelChats;
37+
return this;
38+
}
39+
40+
@Override
41+
public int hashCode() {
42+
return Objects.hash(query,
43+
allow_user_chats,
44+
allow_bot_chats,
45+
allow_group_chats,
46+
allow_channel_chats
47+
);
48+
}
49+
50+
@Override
51+
public String toString() {
52+
return "SwitchInlineQueryChosenChat{" +
53+
"query='" + query + '\'' +
54+
", allow_user_chats=" + allow_user_chats +
55+
", allow_bot_chats=" + allow_bot_chats +
56+
", allow_group_chats=" + allow_group_chats +
57+
", allow_channel_chats='" + allow_channel_chats + '\'' +
58+
'}';
59+
}
60+
61+
}

0 commit comments

Comments
 (0)