Skip to content

Commit 788f751

Browse files
author
Syfaro
committed
Add helpers for creating inline query results.
1 parent 8a8b8a0 commit 788f751

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

helpers.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,49 @@ func NewWebhookWithCert(link string, file interface{}) WebhookConfig {
281281
Certificate: file,
282282
}
283283
}
284+
285+
// NewInlineQueryResultArticle creates a new inline query article.
286+
func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle {
287+
return InlineQueryResultArticle{
288+
Type: "article",
289+
ID: id,
290+
Title: title,
291+
MessageText: messageText,
292+
}
293+
}
294+
295+
// NewInlineQueryResultGIF creates a new inline query GIF.
296+
func NewInlineQueryResultGIF(id, url string) InlineQueryResultGIF {
297+
return InlineQueryResultGIF{
298+
Type: "gif",
299+
ID: id,
300+
URL: url,
301+
}
302+
}
303+
304+
// NewInlineQueryResultMPEG4GIF creates a new inline query MPEG4 GIF.
305+
func NewInlineQueryResultMPEG4GIF(id, url string) InlineQueryResultMPEG4GIF {
306+
return InlineQueryResultMPEG4GIF{
307+
Type: "mpeg4_gif",
308+
ID: id,
309+
URL: url,
310+
}
311+
}
312+
313+
// NewInlineQueryResultPhoto creates a new inline query photo.
314+
func NewInlineQueryResultPhoto(id, url string) InlineQueryResultPhoto {
315+
return InlineQueryResultPhoto{
316+
Type: "photo",
317+
ID: id,
318+
URL: url,
319+
}
320+
}
321+
322+
// NewInlineQueryResultVideo creates a new inline query video.
323+
func NewInlineQueryResultVideo(id, url string) InlineQueryResultVideo {
324+
return InlineQueryResultVideo{
325+
Type: "video",
326+
ID: id,
327+
URL: url,
328+
}
329+
}

0 commit comments

Comments
 (0)