Skip to content

Commit e73274e

Browse files
committed
feat: SwitchInlineQueryButton + SwitchInlineQueryCurrentChatButton
1 parent 9ff2cd7 commit e73274e

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

botkb/buttons.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,31 @@ package botkb
33
type ButtonType int
44

55
type Button interface {
6+
GetText() string
67
ButtonType() ButtonType
78
}
89

910
const (
1011
ButtonTypeData ButtonType = iota
1112
ButtonTypeURL
13+
ButtonTypeSwitchInlineQuery
14+
ButtonTypeSwitchInlineQueryCurrentChat
1215
)
1316

1417
var _ Button = (*DataButton)(nil)
1518
var _ Button = (*UrlButton)(nil)
19+
var _ Button = (*SwitchInlineQueryButton)(nil)
20+
var _ Button = (*SwitchInlineQueryCurrentChatButton)(nil)
1621

1722
type DataButton struct {
1823
Text string
1924
Data string
2025
}
2126

27+
func (b DataButton) GetText() string {
28+
return b.Text
29+
}
30+
2231
func (DataButton) ButtonType() ButtonType {
2332
return ButtonTypeData
2433
}
@@ -31,3 +40,33 @@ type UrlButton struct {
3140
func (UrlButton) ButtonType() ButtonType {
3241
return ButtonTypeURL
3342
}
43+
44+
func (b UrlButton) GetText() string {
45+
return b.Text
46+
}
47+
48+
type SwitchInlineQueryButton struct {
49+
Text string
50+
Query string
51+
}
52+
53+
func (SwitchInlineQueryButton) ButtonType() ButtonType {
54+
return ButtonTypeSwitchInlineQuery
55+
}
56+
57+
func (b SwitchInlineQueryButton) GetText() string {
58+
return b.Text
59+
}
60+
61+
type SwitchInlineQueryCurrentChatButton struct {
62+
Text string
63+
Query string
64+
}
65+
66+
func (SwitchInlineQueryCurrentChatButton) ButtonType() ButtonType {
67+
return ButtonTypeSwitchInlineQueryCurrentChat
68+
}
69+
70+
func (b SwitchInlineQueryCurrentChatButton) GetText() string {
71+
return b.Text
72+
}

0 commit comments

Comments
 (0)