Add ReplyKeyboard and ForceReply

This commit is contained in:
Hamcha 2019-08-23 10:37:18 +02:00
parent d7698a3c50
commit 651f25be88
Signed by: hamcha
GPG Key ID: 44AD3571EB09A39E
2 changed files with 29 additions and 1 deletions

27
api.go
View File

@ -180,8 +180,33 @@ type APIInlineQueryResultPhoto struct {
//TODO inputMessageContent
}
type APIReplyKeyboardMarkup struct {
Keyboard [][]APIKeyboardButton `json:"keyboard"` // Grid of buttons
Resize bool `json:"resize_keyboard,omitempty"`
OneTime bool `json:"one_time_keyboard,omitempty"`
Selective bool `json:"selective,omitempty"`
}
// APIForceReply forces the reply textbox to open after receiving a message
type APIForceReply struct {
ForceReply bool `json:"force_reply"`
Selective bool `json:"selective,omitempty"`
}
// APIKeyboardButton is a custom keyboard button
type APIKeyboardButton struct {
Text string `json:"text"`
RequestContact bool `json:"request_contact,omitempty"`
RequestLocation bool `json:"request_location,omitempty"`
}
type APIReplyKeyboardRemove struct {
RemoveKeyboard bool `json:"remove_keyboard"`
Selective bool `json:"selective,omitempty"`
}
type APIInlineKeyboardMarkup struct {
InlineKeyboard interface{} `json:"inline_keyboard"`
InlineKeyboard [][]APIInlineKeyboardButton `json:"inline_keyboard"`
}
// APIInlineKeyboardButton is an inline message button

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module git.fromouter.space/hamcha/tg
go 1.12