Skip to content

Commit

Permalink
add ability to respond to inline queries with stickers
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Leining committed Jan 5, 2020
1 parent b33efee commit 87891c1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,16 @@ func NewInlineQueryResultCachedVideo(id, videoID, title string) InlineQueryResul
}
}

// NewInlineQueryResultCachedSticker create a new inline query with cached sticker.
func NewInlineQueryResultCachedSticker(id, stickerID, title string) InlineQueryResultCachedSticker {
return InlineQueryResultCachedSticker{
Type: "sticker",
ID: id,
StickerID: stickerID,
Title: title,
}
}

// NewInlineQueryResultAudio creates a new inline query audio.
func NewInlineQueryResultAudio(id, url, title string) InlineQueryResultAudio {
return InlineQueryResultAudio{
Expand Down Expand Up @@ -622,7 +632,7 @@ func NewEditMessageCaption(chatID int64, messageID int, caption string) EditMess
ChatID: chatID,
MessageID: messageID,
},
Caption: caption,
Caption: caption,
}
}

Expand Down
11 changes: 11 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,17 @@ type InlineQueryResultCachedVideo struct {
InputMessageContent interface{} `json:"input_message_content,omitempty"`
}

// InlineQueryResultCachedSticker is an inline query response with cached sticker.
type InlineQueryResultCachedSticker struct {
Type string `json:"type"` // required
ID string `json:"id"` // required
StickerID string `json:"sticker_file_id"` // required
Title string `json:"title"` // required
ParseMode string `json:"parse_mode"`
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
InputMessageContent interface{} `json:"input_message_content,omitempty"`
}

// InlineQueryResultAudio is an inline query response audio.
type InlineQueryResultAudio struct {
Type string `json:"type"` // required
Expand Down

0 comments on commit 87891c1

Please sign in to comment.