Skip to content

GramIO API Reference / @gramio/keyboards/dist / InlineQueryResult

Class: InlineQueryResult

Defined in: keyboards/index.d.ts:775

Result of InlineQuery builder.

Example

ts
bot.api.answerInlineQuery({
	inline_query_id: context.id,
	results: [
		InlineQueryResult.article(
			"id-1",
			"some article",
			InputMessageContent.text("my article"),
		),
	],
});

Documentation

Constructors

Constructor

new InlineQueryResult(): InlineQueryResult

Returns

InlineQueryResult

Properties

PropertyModifierTypeDescriptionDefined in
cachedstatictypeof InlineQueryResultCachedCached result of InlineQuery builder.keyboards/index.d.ts:777

Methods

article()

static article(id, title, inputMessageContent, options?): TelegramInlineQueryResultArticle

Defined in: keyboards/index.d.ts:783

Represents a link to an article or web page.

Documentation

Parameters

ParameterType
idstring
titlestring
inputMessageContentTelegramInputMessageContent
options?Omit<TelegramInlineQueryResultArticle, "type" | "title" | "id" | "input_message_content">

Returns

TelegramInlineQueryResultArticle


audio()

static audio(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.

Documentation

Parameters

ParameterType
idstring
titlestring
audioUrlstring
options?Omit<TelegramInlineQueryResultAudio, "type" | "title" | "id" | "audio_url">

Returns

TelegramInlineQueryResultAudio


contact()

static contact(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.

Documentation

Parameters

ParameterType
idstring
phoneNumberstring
firstNamestring
options?Omit<TelegramInlineQueryResultContact, "type" | "phone_number" | "id" | "first_name">

Returns

TelegramInlineQueryResultContact


documentPdf()

static documentPdf(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.

Documentation

Parameters

ParameterType
idstring
titlestring
urlstring
options?Omit<TelegramInlineQueryResultDocument, "type" | "mime_type" | "id" | "title" | "document_url">

Returns

TelegramInlineQueryResultDocument


documentZip()

static documentZip(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.

Documentation

Parameters

ParameterType
idstring
titlestring
urlstring
options?Omit<TelegramInlineQueryResultDocument, "type" | "mime_type" | "id" | "title" | "document_url">

Returns

TelegramInlineQueryResultDocument


game()

static game(id, gameShortName, options?): TelegramInlineQueryResultGame

Defined in: keyboards/index.d.ts:801

Represents a Game.

Documentation

Parameters

ParameterType
idstring
gameShortNamestring
options?Omit<TelegramInlineQueryResultGame, "type" | "game_short_name" | "id">

Returns

TelegramInlineQueryResultGame


gif()

static gif(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.

Documentation

Parameters

ParameterType
idstring
gifUrlstring
thumbnailUrlstring
options?Omit<TelegramInlineQueryResultGif, "type" | "gif_url" | "id" | "thumbnail_url">

Returns

TelegramInlineQueryResultGif


location()

static location(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.

Documentation

Parameters

ParameterType
idstring
latitudenumber
longitudenumber
titlestring
options?Omit<TelegramInlineQueryResultLocation, "type" | "latitude" | "id" | "longitude" | "title">

Returns

TelegramInlineQueryResultLocation


mpeg4Gif()

static mpeg4Gif(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.

Documentation

Parameters

ParameterType
idstring
mpeg4Urlstring
thumbnailUrlstring
options?Omit<TelegramInlineQueryResultMpeg4Gif, "type" | "mpeg4_url" | "id" | "thumbnail_url">

Returns

TelegramInlineQueryResultMpeg4Gif


photo()

static photo(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.

Documentation

Parameters

ParameterType
idstring
photoUrlstring
thumbnailUrlstring
options?Omit<TelegramInlineQueryResultPhoto, "type" | "photo_url" | "id" | "thumbnail_url">

Returns

TelegramInlineQueryResultPhoto


venue()

static venue(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.

Documentation

Parameters

ParameterType
idstring
optionsOmit<TelegramInlineQueryResultVenue, "type" | "id">

Returns

TelegramInlineQueryResultVenue


videoHtml()

static videoHtml(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.

Documentation

Parameters

ParameterType
idstring
titlestring
videoUrlstring
thumbnailUrlstring
options?Omit<TelegramInlineQueryResultVideo, "type" | "video_url" | "id" | "thumbnail_url" | "mime_type" | "title">

Returns

TelegramInlineQueryResultVideo


videoMp4()

static videoMp4(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.

Documentation

Parameters

ParameterType
idstring
titlestring
videoUrlstring
thumbnailUrlstring
options?Omit<TelegramInlineQueryResultVideo, "type" | "video_url" | "id" | "thumbnail_url" | "mime_type" | "title">

Returns

TelegramInlineQueryResultVideo


voice()

static voice(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.

Documentation

Parameters

ParameterType
idstring
titlestring
urlstring
options?Omit<TelegramInlineQueryResultVoice, "type" | "voice_url" | "id" | "title">

Returns

TelegramInlineQueryResultVoice