@botname query. Your bot receives the query, builds a list of results, and Telegram displays them as a gallery above the input field.
Enabling inline mode
Open @BotFather
Send
/mybots, select your bot, choose Bot Settings, then Inline Mode, and turn it on.The Query object
Building results
Results are collected in atele.Results slice. Every result embeds ResultBase which provides SetResultID(), SetParseMode(), SetContent(), and SetReplyMarkup().
ArticleResult
PhotoResult
VideoResult
AudioResult
Other result types
GifResult
An animated GIF. Provide
URL, ThumbURL, optional Width/Height/Duration.Mpeg4GifResult
An H.264 video without sound. Provide
URL, optional ThumbURL.DocumentResult
A PDF or ZIP file. MIME must be
application/pdf or application/zip.LocationResult
Embeds a
tele.Location (Lat/Lng) plus a Title.VenueResult
A venue with
Location, Title, Address, optional FoursquareID.ContactResult
A phone contact with
PhoneNumber, FirstName, optional VCard.VoiceResult
An OGG voice recording at
URL with a Title.StickerResult
A cached sticker by
Cache (file ID).Cached results
If you have aFileID from a previous upload, use the Cache field to avoid re-uploading:
Responding to queries
Callc.Answer() with a *tele.QueryResponse:
QueryResponse fields
Deep linking via SwitchPMText
Add a button that opens a private chat with your bot (useful for login flows):/start login_prompt to your bot in a private chat. Handle it:
Handling chosen inline results
Telegram can notify your bot when the user picks a result. Enable Inline Feedback in @BotFather, then handletele.OnInlineResult: