48 nl::json json = nl::json::object();
62 void _fromJson(
const nl::json& json) {
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field)
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)
Represents a link to an article or web page. https://core.telegram.org/bots/api#inlinequeryresultarti...
void fromJson(const nl::json &json) override
std::string thumbnailUrl
Optional. Url of the thumbnail for the result.
bool hideUrl
Optional. Pass True if you don't want the URL to be shown in the message.
InlineQueryResultArticle()
std::string description
Optional. Short description of the result.
std::int32_t thumbnailWidth
Optional. Thumbnail width.
std::int32_t thumbnailHeight
Optional. Thumbnail height.
Ptr< InputMessageContent > inputMessageContent
Content of the message to be sent.
nl::json toJson() const override
std::string url
Optional. URL of the result.
InlineQueryResultArticle(const nl::json &json)
std::string title
Title of the result.
Represents a link to an MP3 audio file. By default, this audio file will be sent by the user....
std::string performer
Optional. Performer.
void fromJson(const nl::json &json) override
std::string parseMode
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
std::int32_t audioDuration
Optional. Audio duration in seconds.
InlineQueryResultAudio(const nl::json &json)
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string caption
Optional. Caption, 0-1024 characters after entities parsing.
std::string audioUrl
A valid URL for the audio file.
nl::json toJson() const override
Represents a link to an MP3 audio file stored on the Telegram servers. By default,...
std::string parseMode
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
void fromJson(const nl::json &json) override
InlineQueryResultCachedAudio(const nl::json &json)
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the voice caption, which can be specified instead o...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the audio.
std::string caption
Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing.
std::string audioFileId
A valid file identifier for the audio file.
InlineQueryResultCachedAudio()
nl::json toJson() const override
Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the document.
std::string caption
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing.
std::string title
Title for the result.
void fromJson(const nl::json &json) override
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string description
Optional. Short description of the result.
std::string documentFileId
A valid file identifier for the file.
std::string parseMode
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
InlineQueryResultCachedDocument(const nl::json &json)
nl::json toJson() const override
InlineQueryResultCachedDocument()
Represents a link to an animated GIF file stored on the Telegram servers. By default,...
std::string parseMode
Optional. Mode for parsing entities in the GIF caption. See formatting options for more details.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the GIF.
void fromJson(const nl::json &json) override
std::string gifFileId
A valid file identifier for the GIF file.
InlineQueryResultCachedGif()
std::string title
Optional. Title for the result.
std::string caption
Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
InlineQueryResultCachedGif(const nl::json &json)
nl::json toJson() const override
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram ...
std::string parseMode
Optional. Mode for parsing entities in the MPEG-4 caption. See formatting options for more details.
std::string title
Optional. Title for the result.
std::string mpeg4FileId
A valid file identifier for the MPEG4 file.
nl::json toJson() const override
Ptr< InputMessageContent > inputMessageContent
Optional. Optional. Content of the message to be sent instead of the video animation.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
InlineQueryResultCachedMpeg4Gif()
InlineQueryResultCachedMpeg4Gif(const nl::json &json)
std::string caption
Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing.
void fromJson(const nl::json &json) override
Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by t...
nl::json toJson() const override
void fromJson(const nl::json &json) override
std::string photoFileId
A valid file identifier of the photo.
std::string caption
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the photo.
InlineQueryResultCachedPhoto(const nl::json &json)
std::string description
Optional. Short description of the result.
std::string parseMode
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
std::string title
Optional. Title for the result.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
InlineQueryResultCachedPhoto()
Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent ...
InlineQueryResultCachedSticker()
void fromJson(const nl::json &json) override
nl::json toJson() const override
Ptr< InputMessageContent > inputMessageContent
Optional. Optional. Content of the message to be sent instead of the sticker.
std::string stickerFileId
A valid file identifier of the sticker.
InlineQueryResultCachedSticker(const nl::json &json)
Represents a link to a video file stored on the Telegram servers. By default, this video file will be...
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the video caption, which can be specified instead o...
std::string videoFileId
A valid file identifier for the video file.
InlineQueryResultCachedVideo()
std::string description
Optional. Short description of the result.
void fromJson(const nl::json &json) override
InlineQueryResultCachedVideo(const nl::json &json)
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video.
std::string title
Title for the result.
nl::json toJson() const override
std::string parseMode
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
std::string caption
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing.
Represents a link to a voice message stored on the Telegram servers. By default, this voice message w...
nl::json toJson() const override
std::string parseMode
Optional. Mode for parsing entities in the voice caption. See formatting options for more details.
std::string voiceFileId
A valid file identifier for the voice message.
std::string title
Voice message title.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the voice caption, which can be specified instead o...
std::string caption
Optional. Caption of the voice to be sent, 0-1024 characters after entities parsing.
InlineQueryResultCachedVoice(const nl::json &json)
std::string description
Optional. Short description of the result.
InlineQueryResultCachedVoice()
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the voice.
void fromJson(const nl::json &json) override
Represents a link to a file. By default, this file will be sent by the user with an optional caption....
InlineQueryResultDocument()
std::string documentUrl
A valid URL for the file.
std::string parseMode
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
void fromJson(const nl::json &json) override
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
std::string description
Optional. Short description of the result.
nl::json toJson() const override
std::string thumbnailUrl
Optional. URL of the thumbnail (JPEG only) for the file.
InlineQueryResultDocument(const nl::json &json)
std::string caption
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
std::string title
Title for the result.
std::string mimeType
MIME type of the content of the file, either “application/pdf” or “application/zip”
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
InlineQueryResultGame(const nl::json &json)
nl::json toJson() const override
void fromJson(const nl::json &json) override
std::string gameShortName
Short name of the game.
Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the use...
std::string parseMode
Optional. Mode for parsing entities in the caption. See formatting options for more details.
std::string title
Optional. Title for the result.
std::string caption
Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
std::string gifUrl
A valid URL for the GIF file. File size must not exceed 1MB.
std::int32_t gifWidth
Optional. Width of the GIF.
void fromJson(const nl::json &json) override
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string thumbnailUrl
URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
std::int32_t gifHeight
Optional. Height of the GIF.
std::int32_t gifDuration
Optional. Duration of the GIF in seconds.
InlineQueryResultGif(const nl::json &json)
std::string thumbnailMimeType
Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”....
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the GIF animation.
nl::json toJson() const override
Base class of all inline query results This object represents one result of an inline query....
InlineQueryResult(const nl::json &json)
std::string type
Type of the result.
virtual nl::json toJson() const
virtual void fromJson(const nl::json &json)
InlineQueryResult()=default
Ptr< InlineKeyboardMarkup > replyMarkup
Optional. Inline keyboard attached to the message.
std::string id
Unique identifier for this result, 1-64 bytes.
Represents a location on a map. By default, the location will be sent by the user....
InlineQueryResultLocation(const nl::json &json)
std::int32_t livePeriod
Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
void fromJson(const nl::json &json) override
std::int32_t heading
Optional. For live locations, a direction in which the user is moving, in degrees....
std::string thumbnailUrl
Optional. URL of the thumbnail (JPEG only) for the file.
float latitude
Location latitude in degrees.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the location.
std::string title
Location title.
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
std::int32_t proximityAlertRadius
Optional. For live locations, a maximum distance for proximity alerts about approaching another chat ...
float horizontalAccuracy
Optional. The radius of uncertainty for the location, measured in meters; 0-1500.
InlineQueryResultLocation()
nl::json toJson() const override
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
float longitude
Location longitude in degrees.
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default,...
std::int32_t mpeg4Width
Optional. Video width.
std::string thumbnailUrl
URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
std::int32_t mpeg4Duration
Optional. Video duration in seconds.
InlineQueryResultMpeg4Gif()
std::string mpeg4Url
A valid URL for the MPEG4 file. File size must not exceed 1MB.
std::string parseMode
Optional. Mode for parsing entities in the caption. See formatting options for more details.
InlineQueryResultMpeg4Gif(const nl::json &json)
std::string caption
Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing.
std::int32_t mpeg4Height
Optional. Video height.
std::string thumbnailMimeType
Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”....
void fromJson(const nl::json &json) override
std::string title
Optional. Title for the result.
nl::json toJson() const override
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video animation.
Represents a link to a photo. By default, this photo will be sent by the user with optional caption....
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the photo.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
InlineQueryResultPhoto(const nl::json &json)
std::string title
Optional. Title for the result.
void fromJson(const nl::json &json) override
std::string photoUrl
A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB.
std::string caption
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing.
std::int32_t photoHeight
Optional. Height of the photo.
std::string thumbnailUrl
URL of the thumbnail for the photo.
nl::json toJson() const override
std::string parseMode
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
std::string description
Optional. Short description of the result.
std::int32_t photoWidth
Optional. Width of the photo.
Represents a venue. By default, the venue will be sent by the user. Alternatively,...
std::string title
Title of the venue.
std::string googlePlaceId
Optional. Google Places identifier of the venue.
float longitude
Longitude of the venue location in degrees.
std::string foursquareType
Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”,...
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
std::string address
Address of the venue.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the venue.
nl::json toJson() const override
float latitude
Latitude of the venue location in degrees.
std::string googlePlaceType
Optional. Google Places type of the venue. (See supported types.)
std::string foursquareId
Optional. Foursquare identifier of the venue if known.
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
InlineQueryResultVenue(const nl::json &json)
void fromJson(const nl::json &json) override
std::string thumbnailUrl
Optional. URL of the thumbnail (JPEG only) for the file.
Represents a link to a page containing an embedded video player or a video file. By default,...
std::string title
Optional. Title for the result.
std::int32_t videoWidth
Optional. Video width.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string mimeType
MIME type of the content of the video URL, “text/html” or “video/mp4”
std::string parseMode
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
std::string caption
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing.
std::string description
Optional. Short description of the result.
std::string thumbnailUrl
URL of the thumbnail (JPEG only) for the video.
std::int32_t videoHeight
Optional. Video height.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
InlineQueryResultVideo(const nl::json &json)
std::string videoUrl
A valid URL for the embedded video player or video file.
nl::json toJson() const override
void fromJson(const nl::json &json) override
std::int32_t videoDuration
Optional. Video duration in seconds.
Represents a link to a voice recording in an .OGG container encoded with OPUS. By default,...
std::string parseMode
Optional. Mode for parsing entities in the voice caption. See formatting options for more details.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
nl::json toJson() const override
std::string title
Recording title.
std::string voiceUrl
A valid URL for the voice recording.
std::string performer
Optional. Performer.
std::string caption
Optional. Caption, 0-1024 characters after entities parsing.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
void fromJson(const nl::json &json) override
InlineQueryResultVoice(const nl::json &json)
std::int32_t voiceDuration
Optional. Recording duration in seconds.