telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Class InlineQueryResultBuilder

    Fluent builder utility for constructing type-safe InlineQueryResult objects.

    const results = [
    InlineQueryResultBuilder.article("1", "Search Google")
    .text("https://google.com"),
    InlineQueryResultBuilder.photo("2", "https://example.com/image.jpg", {
    title: "Nature Wallpaper",
    caption: "Beautiful sunset view",
    }),
    ];

    await context.bot.answerInlineQuery({
    inline_query_id: context.update!.inline_query!.id,
    results,
    });
    Index

    Staticarticle

    • Creates an audio inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • audioUrl: string

        A valid URL for the audio file.

      • title: string

        Title of the audio track.

      • options: BaseInlineResultOptions & {
            audio_duration?: number;
            caption?: string;
            parse_mode?: string;
            performer?: string;
        } = {}

        Additional options such as performer, caption, and duration.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a contact inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • phoneNumber: string

        Contact's phone number.

      • firstName: string

        Contact's first name.

      • options: BaseInlineResultOptions & {
            last_name?: string;
            thumbnail_url?: string;
            vcard?: string;
        } = {}

        Additional options such as last name and vCard.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a document inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • title: string

        Title for the result.

      • documentUrl: string

        A valid URL for the file.

      • mimeType: string

        MIME type of the content of the file.

      • options: BaseInlineResultOptions & {
            caption?: string;
            description?: string;
            parse_mode?: string;
            thumbnail_url?: string;
        } = {}

        Additional options such as description, caption, and thumbnail.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a GIF animation inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • gifUrl: string

        A valid URL for the GIF file.

      • thumbnailUrl: string

        URL of the static (JPEG or GIF) thumbnail for the result.

      • options: BaseInlineResultOptions & {
            caption?: string;
            gif_duration?: number;
            gif_height?: number;
            gif_width?: number;
            parse_mode?: string;
            title?: string;
        } = {}

        Additional options such as title, caption, and dimensions.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a location inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • latitude: number

        Location latitude in degrees.

      • longitude: number

        Location longitude in degrees.

      • title: string

        Location title.

      • options: BaseInlineResultOptions & {
            heading?: number;
            horizontal_accuracy?: number;
            live_period?: number;
            proximity_alert_radius?: number;
            thumbnail_url?: string;
        } = {}

        Additional options such as live period and heading.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a photo inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • photoUrl: string

        A valid URL of the photo. The photo must be in JPEG format and size must not exceed 5MB.

      • options: PhotoResultOptions = {}

        Additional options such as title, caption, and thumbnail.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a venue inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • latitude: number

        Latitude of the venue in degrees.

      • longitude: number

        Longitude of the venue in degrees.

      • title: string

        Title of the venue.

      • address: string

        Address of the venue.

      • options: BaseInlineResultOptions & {
            foursquare_id?: string;
            foursquare_type?: string;
            google_place_id?: string;
            google_place_type?: string;
            thumbnail_url?: string;
        } = {}

        Additional options such as foursquare ID or Google Places ID.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.

    • Creates a video inline query result.

      Parameters

      • id: string

        Unique identifier for this result.

      • videoUrl: string

        A valid URL for the embedded video player or video file.

      • mimeType: string

        MIME type of the content of the video URL, "text/html" or "video/mp4".

      • thumbnailUrl: string

        URL of the thumbnail (JPEG or GIF) for the video.

      • title: string

        Title for the result.

      • options: BaseInlineResultOptions & {
            caption?: string;
            description?: string;
            parse_mode?: string;
            video_duration?: number;
            video_height?: number;
            video_width?: number;
        } = {}

        Additional options such as caption and duration.

      Returns InlineQueryResult

      Constructed InlineQueryResult object.