tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::LinkPreviewOptions Struct Reference

Describes the options used for link preview generation. https://core.telegram.org/bots/api#linkpreviewoptions. More...

#include <LinkPreviewOptions.hpp>

Public Member Functions

 LinkPreviewOptions ()=default
 
 LinkPreviewOptions (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON.
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON.
 

Public Attributes

bool isDisabled {}
 Optional. True, if the link preview is disabled.
 
std::string url
 Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used.
 
bool preferSmallMedia {}
 Optional. 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.
 
bool preferLargeMedia {}
 Optional. 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.
 
bool showAboveText {}
 Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text.
 

Detailed Description

Describes the options used for link preview generation. https://core.telegram.org/bots/api#linkpreviewoptions.

Definition at line 7 of file LinkPreviewOptions.hpp.

Constructor & Destructor Documentation

◆ LinkPreviewOptions() [1/2]

tgbotxx::LinkPreviewOptions::LinkPreviewOptions ( )
default

◆ LinkPreviewOptions() [2/2]

tgbotxx::LinkPreviewOptions::LinkPreviewOptions ( const nl::json &  json)
inlineexplicit

Definition at line 9 of file LinkPreviewOptions.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::LinkPreviewOptions::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 45 of file LinkPreviewOptions.hpp.

◆ toJson()

nl::json tgbotxx::LinkPreviewOptions::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 34 of file LinkPreviewOptions.hpp.

Member Data Documentation

◆ isDisabled

bool tgbotxx::LinkPreviewOptions::isDisabled {}

Optional. True, if the link preview is disabled.

Definition at line 14 of file LinkPreviewOptions.hpp.

◆ preferLargeMedia

bool tgbotxx::LinkPreviewOptions::preferLargeMedia {}

Optional. 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.

Definition at line 25 of file LinkPreviewOptions.hpp.

◆ preferSmallMedia

bool tgbotxx::LinkPreviewOptions::preferSmallMedia {}

Optional. 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.

Definition at line 21 of file LinkPreviewOptions.hpp.

◆ showAboveText

bool tgbotxx::LinkPreviewOptions::showAboveText {}

Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text.

Definition at line 29 of file LinkPreviewOptions.hpp.

◆ url

std::string tgbotxx::LinkPreviewOptions::url

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

Definition at line 17 of file LinkPreviewOptions.hpp.


The documentation for this struct was generated from the following file: