From 651f25be88e4e57e8b6e63d3c2494032400959fc Mon Sep 17 00:00:00 2001 From: Hamcha Date: Fri, 23 Aug 2019 10:37:18 +0200 Subject: [PATCH] Add ReplyKeyboard and ForceReply --- api.go | 27 ++++++++++++++++++++++++++- go.mod | 3 +++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 go.mod diff --git a/api.go b/api.go index bcefde5..1b1e481 100644 --- a/api.go +++ b/api.go @@ -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 diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f894e36 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.fromouter.space/hamcha/tg + +go 1.12