all repos — telegram-bot-api @ 645b5629abc6a6c3f0721623992fd7183c48ae58

Golang bindings for the Telegram Bot API

Add helpers for creating inline query results.
Syfaro syfaro@foxpaw.in
Mon, 18 Jan 2016 00:06:48 -0600
commit

645b5629abc6a6c3f0721623992fd7183c48ae58

parent

67ab387694d0239a236cc24c4a467b739a831881

1 files changed, 46 insertions(+), 0 deletions(-)

jump to
M helpers.gohelpers.go

@@ -281,3 +281,49 @@ URL: u,

Certificate: file, } } + +// NewInlineQueryResultArticle creates a new inline query article. +func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle { + return InlineQueryResultArticle{ + Type: "article", + ID: id, + Title: title, + MessageText: messageText, + } +} + +// NewInlineQueryResultGIF creates a new inline query GIF. +func NewInlineQueryResultGIF(id, url string) InlineQueryResultGIF { + return InlineQueryResultGIF{ + Type: "gif", + ID: id, + URL: url, + } +} + +// NewInlineQueryResultMPEG4GIF creates a new inline query MPEG4 GIF. +func NewInlineQueryResultMPEG4GIF(id, url string) InlineQueryResultMPEG4GIF { + return InlineQueryResultMPEG4GIF{ + Type: "mpeg4_gif", + ID: id, + URL: url, + } +} + +// NewInlineQueryResultPhoto creates a new inline query photo. +func NewInlineQueryResultPhoto(id, url string) InlineQueryResultPhoto { + return InlineQueryResultPhoto{ + Type: "photo", + ID: id, + URL: url, + } +} + +// NewInlineQueryResultVideo creates a new inline query video. +func NewInlineQueryResultVideo(id, url string) InlineQueryResultVideo { + return InlineQueryResultVideo{ + Type: "video", + ID: id, + URL: url, + } +}