GramIO API Reference / @gramio/keyboards/dist / InlineQueryResult
Class: InlineQueryResult
Defined in: keyboards/index.d.ts:775
Result of InlineQuery builder.
Example
bot.api.answerInlineQuery({
inline_query_id: context.id,
results: [
InlineQueryResult.article(
"id-1",
"some article",
InputMessageContent.text("my article"),
),
],
});Constructors
Constructor
new InlineQueryResult():
InlineQueryResult
Returns
InlineQueryResult
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
cached | static | typeof InlineQueryResultCached | Cached result of InlineQuery builder. | keyboards/index.d.ts:777 |
Methods
article()
staticarticle(id,title,inputMessageContent,options?):TelegramInlineQueryResultArticle
Defined in: keyboards/index.d.ts:783
Represents a link to an article or web page.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
inputMessageContent | TelegramInputMessageContent |
options? | Omit<TelegramInlineQueryResultArticle, "type" | "title" | "id" | "input_message_content"> |
Returns
TelegramInlineQueryResultArticle
audio()
staticaudio(id,title,audioUrl,options?):TelegramInlineQueryResultAudio
Defined in: keyboards/index.d.ts:789
Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
audioUrl | string |
options? | Omit<TelegramInlineQueryResultAudio, "type" | "title" | "id" | "audio_url"> |
Returns
TelegramInlineQueryResultAudio
contact()
staticcontact(id,phoneNumber,firstName,options?):TelegramInlineQueryResultContact
Defined in: keyboards/index.d.ts:795
Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
Parameters
| Parameter | Type |
|---|---|
id | string |
phoneNumber | string |
firstName | string |
options? | Omit<TelegramInlineQueryResultContact, "type" | "phone_number" | "id" | "first_name"> |
Returns
TelegramInlineQueryResultContact
documentPdf()
staticdocumentPdf(id,title,url,options?):TelegramInlineQueryResultDocument
Defined in: keyboards/index.d.ts:807
Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
url | string |
options? | Omit<TelegramInlineQueryResultDocument, "type" | "mime_type" | "id" | "title" | "document_url"> |
Returns
TelegramInlineQueryResultDocument
documentZip()
staticdocumentZip(id,title,url,options?):TelegramInlineQueryResultDocument
Defined in: keyboards/index.d.ts:813
Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
url | string |
options? | Omit<TelegramInlineQueryResultDocument, "type" | "mime_type" | "id" | "title" | "document_url"> |
Returns
TelegramInlineQueryResultDocument
game()
staticgame(id,gameShortName,options?):TelegramInlineQueryResultGame
Defined in: keyboards/index.d.ts:801
Represents a Game.
Parameters
| Parameter | Type |
|---|---|
id | string |
gameShortName | string |
options? | Omit<TelegramInlineQueryResultGame, "type" | "game_short_name" | "id"> |
Returns
gif()
staticgif(id,gifUrl,thumbnailUrl,options?):TelegramInlineQueryResultGif
Defined in: keyboards/index.d.ts:819
Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
Parameters
| Parameter | Type |
|---|---|
id | string |
gifUrl | string |
thumbnailUrl | string |
options? | Omit<TelegramInlineQueryResultGif, "type" | "gif_url" | "id" | "thumbnail_url"> |
Returns
location()
staticlocation(id,latitude,longitude,title,options?):TelegramInlineQueryResultLocation
Defined in: keyboards/index.d.ts:825
Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
Parameters
| Parameter | Type |
|---|---|
id | string |
latitude | number |
longitude | number |
title | string |
options? | Omit<TelegramInlineQueryResultLocation, "type" | "latitude" | "id" | "longitude" | "title"> |
Returns
TelegramInlineQueryResultLocation
mpeg4Gif()
staticmpeg4Gif(id,mpeg4Url,thumbnailUrl,options?):TelegramInlineQueryResultMpeg4Gif
Defined in: keyboards/index.d.ts:831
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
Parameters
| Parameter | Type |
|---|---|
id | string |
mpeg4Url | string |
thumbnailUrl | string |
options? | Omit<TelegramInlineQueryResultMpeg4Gif, "type" | "mpeg4_url" | "id" | "thumbnail_url"> |
Returns
TelegramInlineQueryResultMpeg4Gif
photo()
staticphoto(id,photoUrl,thumbnailUrl,options?):TelegramInlineQueryResultPhoto
Defined in: keyboards/index.d.ts:837
Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
Parameters
| Parameter | Type |
|---|---|
id | string |
photoUrl | string |
thumbnailUrl | string |
options? | Omit<TelegramInlineQueryResultPhoto, "type" | "photo_url" | "id" | "thumbnail_url"> |
Returns
TelegramInlineQueryResultPhoto
venue()
staticvenue(id,options):TelegramInlineQueryResultVenue
Defined in: keyboards/index.d.ts:843
Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
Parameters
| Parameter | Type |
|---|---|
id | string |
options | Omit<TelegramInlineQueryResultVenue, "type" | "id"> |
Returns
TelegramInlineQueryResultVenue
videoHtml()
staticvideoHtml(id,title,videoUrl,thumbnailUrl,options?):TelegramInlineQueryResultVideo
Defined in: keyboards/index.d.ts:851
Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
videoUrl | string |
thumbnailUrl | string |
options? | Omit<TelegramInlineQueryResultVideo, "type" | "video_url" | "id" | "thumbnail_url" | "mime_type" | "title"> |
Returns
TelegramInlineQueryResultVideo
videoMp4()
staticvideoMp4(id,title,videoUrl,thumbnailUrl,options?):TelegramInlineQueryResultVideo
Defined in: keyboards/index.d.ts:859
Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
videoUrl | string |
thumbnailUrl | string |
options? | Omit<TelegramInlineQueryResultVideo, "type" | "video_url" | "id" | "thumbnail_url" | "mime_type" | "title"> |
Returns
TelegramInlineQueryResultVideo
voice()
staticvoice(id,title,url,options?):TelegramInlineQueryResultVoice
Defined in: keyboards/index.d.ts:865
Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string |
url | string |
options? | Omit<TelegramInlineQueryResultVoice, "type" | "voice_url" | "id" | "title"> |