forked from go-telegram/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reply_markup.go
116 lines (102 loc) · 5.6 KB
/
reply_markup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package models
type ReplyMarkup any
// InlineKeyboardMarkup https://core.telegram.org/bots/api#inlinekeyboardmarkup
type InlineKeyboardMarkup struct {
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}
// LoginURL https://core.telegram.org/bots/api#loginurl
type LoginURL struct {
URL string `json:"url"`
ForwardText string `json:"forward_text,omitempty"`
BotUsername string `json:"bot_username,omitempty"`
RequestWriteAccess bool `json:"request_write_access,omitempty"`
}
// SwitchInlineQueryChosenChat https://core.telegram.org/bots/api#switchinlinequerychosenchat
type SwitchInlineQueryChosenChat struct {
Query string `json:"query,omitempty"`
AllowUserChats bool `json:"allow_user_chats,omitempty"`
AllowBotChats bool `json:"allow_bot_chats,omitempty"`
AllowGroupChats bool `json:"allow_group_chats,omitempty"`
AllowChannelChats bool `json:"allow_channel_chats,omitempty"`
}
// InlineKeyboardButton https://core.telegram.org/bots/api#inlinekeyboardbutton
type InlineKeyboardButton struct {
Text string `json:"text"`
URL string `json:"url,omitempty"`
CallbackData string `json:"callback_data,omitempty"`
WebApp *WebAppInfo `json:"web_app,omitempty"`
LoginURL *LoginURL `json:"login_url,omitempty"`
SwitchInlineQuery string `json:"switch_inline_query,omitempty"`
SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"`
SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"`
CallbackGame *CallbackGame `json:"callback_game,omitempty"`
Pay bool `json:"pay,omitempty"`
}
// ReplyKeyboardMarkup https://core.telegram.org/bots/api#replykeyboardmarkup
type ReplyKeyboardMarkup struct {
Keyboard [][]KeyboardButton `json:"keyboard"`
IsPersistent bool `json:"is_persistent,omitempty"`
ResizeKeyboard bool `json:"resize_keyboard,omitempty"`
OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`
InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
Selective bool `json:"selective,omitempty"`
}
// KeyboardButton https://core.telegram.org/bots/api#keyboardbutton
type KeyboardButton struct {
Text string `json:"text"`
RequestUser *KeyboardButtonRequestUsers `json:"request_user,omitempty"`
RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"`
RequestChat *KeyboardButtonRequestChat `json:"request_chat,omitempty"`
RequestContact bool `json:"request_contact,omitempty"`
RequestLocation bool `json:"request_location,omitempty"`
RequestPoll *KeyboardButtonPollType `json:"request_poll,omitempty"`
WebApp *WebAppInfo `json:"web_app,omitempty"`
}
// KeyboardButtonRequestUser https://core.telegram.org/bots/api#keyboardbuttonrequestuser
type KeyboardButtonRequestUser struct {
RequestID int32 `json:"request_id"`
UserIsBot bool `json:"user_is_bot,omitempty"`
UserIsPremium bool `json:"user_is_premium,omitempty"`
}
// KeyboardButtonRequestUsers https://core.telegram.org/bots/api#keyboardbuttonrequestusers
type KeyboardButtonRequestUsers struct {
RequestID int32 `json:"request_id"`
UserIsBot bool `json:"user_is_bot,omitempty"`
UserIsPremium bool `json:"user_is_premium,omitempty"`
MaxQuantity int `json:"max_quantity,omitempty"`
}
// KeyboardButtonRequestChat https://core.telegram.org/bots/api#keyboardbuttonrequestchat
type KeyboardButtonRequestChat struct {
RequestID int32 `json:"request_id"`
ChatIsChannel bool `json:"chat_is_channel"`
ChatIsForum bool `json:"chat_is_forum,omitempty"`
ChatHasUsername bool `json:"chat_has_username,omitempty"`
ChatIsCreated bool `json:"chat_is_created,omitempty"`
UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights,omitempty"`
BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights,omitempty"`
BotIsMember bool `json:"bot_is_member,omitempty"`
}
// KeyboardButtonPollType https://core.telegram.org/bots/api#keyboardbuttonpolltype
type KeyboardButtonPollType struct {
Type string `json:"type,omitempty"`
}
type CallbackGame struct {
UserID int64 `json:"user_id"`
Score int `json:"score"`
Force bool `json:"force,omitempty"`
DisableEditMessage bool `json:"disable_edit_message,omitempty"`
ChatID int `json:"chat_id,omitempty"`
MessageID int `json:"message_id,omitempty"`
InlineMessageID int `json:"inline_message_id,omitempty"`
}
// ReplyKeyboardRemove https://core.telegram.org/bots/api#replykeyboardremove
type ReplyKeyboardRemove struct {
RemoveKeyboard bool `json:"remove_keyboard"`
Selective bool `json:"selective,omitempty"`
}
// ForceReply https://core.telegram.org/bots/api#forcereply
type ForceReply struct {
ForceReply bool `json:"force_reply"`
InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
Selective bool `json:"selective,omitempty"`
}