Skip to content

GramIO API Reference / @gramio/contexts/dist / LinkPreviewOptions

Class: LinkPreviewOptions ​

Defined in: contexts/index.d.ts:2026

Describes the options used for link preview generation.

Constructors ​

Constructor ​

new LinkPreviewOptions(payload): LinkPreviewOptions

Defined in: contexts/index.d.ts:2028

Parameters ​

ParameterType
payloadTelegramLinkPreviewOptions

Returns ​

LinkPreviewOptions

Properties ​

PropertyTypeDefined in
payloadTelegramLinkPreviewOptionscontexts/index.d.ts:2027

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

Defined in: contexts/index.d.ts:2030

MDN

Returns ​

string


url ​

Get Signature ​

get url(): string

Defined in: contexts/index.d.ts:2034

URL to use for the link preview. If empty, then the first URL found in the message text will be used

Returns ​

string

Methods ​

isDisabled() ​

isDisabled(): boolean

Defined in: contexts/index.d.ts:2032

true, if the link preview is disabled

Returns ​

boolean


preferLargeMedia() ​

preferLargeMedia(): boolean

Defined in: contexts/index.d.ts:2038

true, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview

Returns ​

boolean


preferSmallMedia() ​

preferSmallMedia(): boolean

Defined in: contexts/index.d.ts:2036

true, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview

Returns ​

boolean


showAboveText() ​

showAboveText(): boolean

Defined in: contexts/index.d.ts:2040

true, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text

Returns ​

boolean