File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
library/src/main/java/com/pengrad/telegrambot Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .pengrad .telegrambot .model .request ;
2+
3+ import java .io .Serializable ;
4+ import java .util .Objects ;
5+
6+ import com .pengrad .telegrambot .model .WebAppInfo ;
7+
8+ public class InlineQueryResultsButton implements Serializable {
9+
10+ private final static long serialVersionUID = 0L ;
11+
12+ private String text ;
13+ private WebAppInfo web_app ;
14+ private String start_parameter ;
15+
16+ public InlineQueryResultsButton (String text , WebAppInfo webApp ) {
17+ this .text = text ;
18+ this .web_app = webApp ;
19+ }
20+
21+ public InlineQueryResultsButton (String text , String startParameter ) {
22+ this .text = text ;
23+ this .start_parameter = startParameter ;
24+ }
25+
26+ public String text () {
27+ return text ;
28+ }
29+
30+ public WebAppInfo webApp () {
31+ return web_app ;
32+ }
33+
34+ public String startParameter () {
35+ return start_parameter ;
36+ }
37+
38+ @ Override
39+ public int hashCode () {
40+ return Objects .hash (text ,
41+ web_app ,
42+ start_parameter );
43+ }
44+
45+ @ Override
46+ public String toString () {
47+ return "InlineQueryResultsButton{" +
48+ "text='" + text + '\'' +
49+ ", web_app=" + web_app +
50+ ", start_parameter='" + start_parameter + '\'' +
51+ '}' ;
52+ }
53+
54+ }
Original file line number Diff line number Diff line change 11package com .pengrad .telegrambot .request ;
22
33import com .pengrad .telegrambot .model .request .InlineQueryResult ;
4+ import com .pengrad .telegrambot .model .request .InlineQueryResultsButton ;
45import com .pengrad .telegrambot .response .BaseResponse ;
56
67/**
@@ -26,10 +27,22 @@ public AnswerInlineQuery nextOffset(String nextOffset) {
2627 return add ("next_offset" , nextOffset );
2728 }
2829
30+ public AnswerInlineQuery button (InlineQueryResultsButton button ) {
31+ return add ("button" , button );
32+ }
33+
34+ /**
35+ * @deprecated Replaced by {@link #button(InlineQueryResultsButton)}
36+ */
37+ @ Deprecated
2938 public AnswerInlineQuery switchPmText (String switchPmText ) {
3039 return add ("switch_pm_text" , switchPmText );
3140 }
3241
42+ /**
43+ * @deprecated Replaced by {@link #button(InlineQueryResultsButton)}
44+ */
45+ @ Deprecated
3346 public AnswerInlineQuery switchPmParameter (String switchPmParameter ) {
3447 return add ("switch_pm_parameter" , switchPmParameter );
3548 }
You can’t perform that action at this time.
0 commit comments