Skip to content

InlineQueryResultArticle

Represents a link to an article or web page.

Fields

typeString = articleRequired
Type of the result, must be article
idStringRequired
Unique identifier for this result, 1-64 Bytes
titleStringRequired
Title of the result
input_message_contentInputMessageContentRequired
Content of the message to be sent
Optional. Inline keyboard attached to the message
urlStringOptional
Optional. URL of the result
descriptionStringOptional
Optional. Short description of the result
thumbnail_urlStringOptional
Optional. Url of the thumbnail for the result
thumbnail_widthIntegerOptional
Optional. Thumbnail width
thumbnail_heightIntegerOptional
Optional. Thumbnail height

GramIO Usage

Build article results with InlineQueryResult.article():

typescript
import {
    format,
    bold,
    InlineKeyboard,
    InlineQueryResult,
    InputMessageContent,
} from "gramio";

bot.inlineQuery(/wiki (.*)/i, async (ctx) => {
    const entry = await lookup(ctx.args![1]);

    await ctx.answer(
        [
            InlineQueryResult.article(
                entry.id,
                entry.title,
                InputMessageContent.text(
                    format`${bold(entry.title)}\n${entry.summary}`
                ),
                {
                    description: entry.shortDescription,
                    url: entry.url,
                    thumbnail_url: entry.thumbJpegUrl, // see warning below
                    thumbnail_width: 200,
                    thumbnail_height: 200,
                    reply_markup: new InlineKeyboard().url(
                        "Open source",
                        entry.url
                    ),
                }
            ),
        ],
        { cache_time: 0 }
    );
});

Thumbnail constraints

thumbnail_url must be a JPEG URL — PNG/WebP silently fail in some Telegram clients and the preview disappears instead of falling back to a default. Keep the image ≤320×320 px and ≤200 KB; oversized JPEGs fail the same way. If previews don't render and the URL is reachable, start by checking the format and dimensions.

input_message_content.message_text on InputTextMessageContent accepts a FormattableString (the result of format`…` ) directly — GramIO preserves entities. Do not call .toString() or set parse_mode.

For the full set of context.answer() options — including button for auth redirects, next_offset for pagination, and is_personal — see the inlineQuery trigger guide.

See Also