yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
Public Member Functions | Private Attributes | List of all members
yatbcpp::Message Class Reference

#include "Message.h"

Collaboration diagram for yatbcpp::Message:
Collaboration graph
[legend]

Public Member Functions

 Message (std::int32_t message_id, std::int32_t date, Chat chat)
 
 Message (const Message &Message)
 
void setFrom (const std::optional< User > &from)
 
void setForward_from (const std::optional< User > &forward_from)
 
void setForward_from_chat (const std::optional< Chat > &forward_from_chat)
 
void setForward_from_message_id (const std::optional< std::int32_t > &forward_from_message_id)
 
void setForward_signature (const std::optional< std::string > &forward_signature)
 
void setForward_date (const std::optional< std::int32_t > &forward_date)
 
void setEdit_date (const std::optional< std::int32_t > &edit_date)
 
void setAuthor_signature (const std::optional< std::string > &author_signature)
 
void setText (const std::optional< std::string > &text)
 
void addEntity (const MessageEntity &messageEntity)
 
void setAudio (const std::optional< Audio > &audio)
 
void setDocument (const std::optional< Document > &document)
 
void addPhoto (const PhotoSize &Photo)
 
void setVideo (const std::optional< Video > &video)
 
void setVoice (const std::optional< Voice > &voice)
 
void setVideo_note (const std::optional< VideoNote > &video_note)
 
void addNew_chat_members (const User &new_chat_member)
 
void setCaption (const std::optional< std::string > &caption)
 
void setContact (const std::optional< Contact > &contact)
 
void setLocation (const std::optional< Location > &location)
 
void setVenue (const std::optional< Venue > &venue)
 
void setNew_chat_member (const std::optional< User > &new_chat_member)
 
void setLeft_chat_member (const std::optional< User > &left_chat_member)
 
void setNew_chat_title (const std::optional< std::string > &new_chat_title)
 
void addNew_chat_photo (const PhotoSize &newchatphoto)
 
void setDelete_chat_photo (const std::optional< bool > &delete_chat_photo)
 
void setGroup_chat_created (const std::optional< bool > &group_chat_created)
 
void setSupergroup_chat_created (const std::optional< bool > &supergroup_chat_created)
 
void setChannel_chat_created (const std::optional< bool > &channel_chat_created)
 
void setMigrate_to_chat_id (const std::optional< long > &migrate_to_chat_id)
 
void setMigrate_from_chat_id (const std::optional< long > &migrate_from_chat_id)
 
std::int32_t getMessage_id () const
 
const std::optional< User > & getFrom () const
 
std::int32_t getDate () const
 
const ChatgetChat () const
 
const std::optional< User > & getForward_from () const
 
const std::optional< Chat > & getForward_from_chat () const
 
const std::optional< std::int32_t > & getForward_from_message_id () const
 
const std::optional< std::string > & getForward_signature () const
 
const std::optional< std::int32_t > & getForward_date () const
 
const std::optional< std::int32_t > & getEdit_date () const
 
const std::optional< std::string > & getAuthor_signature () const
 
const std::optional< std::string > & getText () const
 
const std::vector< MessageEntity > & getEntities () const
 
const std::optional< Audio > & getAudio () const
 
const std::optional< Document > & getDocument () const
 
const std::vector< PhotoSize > & getPhoto () const
 
const std::optional< Video > & getVideo () const
 
const std::optional< Voice > & getVoice () const
 
const std::optional< VideoNote > & getVideo_note () const
 
const std::vector< User > & getNew_chat_members () const
 
const std::optional< std::string > & getCaption () const
 
const std::optional< Contact > & getContact () const
 
const std::optional< Location > & getLocation () const
 
const std::optional< Venue > & getVenue () const
 
const std::optional< User > & getNew_chat_member () const
 
const std::optional< User > & getLeft_chat_member () const
 
const std::optional< std::string > & getNew_chat_title () const
 
const std::vector< PhotoSize > & getNew_chat_photo () const
 
const std::optional< bool > & getDelete_chat_photo () const
 
const std::optional< bool > & getGroup_chat_created () const
 
const std::optional< bool > & getSupergroup_chat_created () const
 
const std::optional< bool > & getChannel_chat_created () const
 
const std::optional< long > & getMigrate_to_chat_id () const
 
const std::optional< long > & getMigrate_from_chat_id () const
 

Private Attributes

std::int32_t message_id
 
std::optional< Userfrom
 
std::int32_t date
 
Chat chat
 
std::optional< Userforward_from
 
std::optional< Chatforward_from_chat
 
std::optional< std::int32_t > forward_from_message_id
 
std::optional< std::string > forward_signature
 
std::optional< std::int32_t > forward_date
 
std::optional< std::int32_t > edit_date
 
std::optional< std::string > author_signature
 
std::optional< std::string > text
 
std::vector< MessageEntityentities
 
std::optional< Audioaudio
 
std::optional< Documentdocument
 
std::vector< PhotoSizephoto
 
std::optional< Videovideo
 
std::optional< Voicevoice
 
std::optional< VideoNotevideo_note
 
std::vector< Usernew_chat_members
 
std::optional< std::string > caption
 
std::optional< Contactcontact
 
std::optional< Locationlocation
 
std::optional< Venuevenue
 
std::optional< Usernew_chat_member
 
std::optional< Userleft_chat_member
 
std::optional< std::string > new_chat_title
 
std::vector< PhotoSizenew_chat_photo
 
std::optional< bool > delete_chat_photo
 
std::optional< bool > group_chat_created
 
std::optional< bool > supergroup_chat_created
 
std::optional< bool > channel_chat_created
 
std::optional< long > migrate_to_chat_id
 
std::optional< long > migrate_from_chat_id
 

Detailed Description

See also https://core.telegram.org/bots/api#message

Definition at line 25 of file Message.h.

Constructor & Destructor Documentation

◆ Message() [1/2]

yatbcpp::Message::Message ( std::int32_t  message_id,
std::int32_t  date,
Chat  chat 
)

◆ Message() [2/2]

Message::Message ( const Message Message)

Definition at line 33 of file Message.cc.

Member Function Documentation

◆ addEntity()

void Message::addEntity ( const MessageEntity messageEntity)

Definition at line 100 of file Message.cc.

◆ addNew_chat_members()

void Message::addNew_chat_members ( const User new_chat_member)

Definition at line 132 of file Message.cc.

◆ addNew_chat_photo()

void Message::addNew_chat_photo ( const PhotoSize newchatphoto)

Definition at line 164 of file Message.cc.

◆ addPhoto()

void Message::addPhoto ( const PhotoSize Photo)

Definition at line 114 of file Message.cc.

◆ getAudio()

const optional< Audio > & Message::getAudio ( ) const

Definition at line 252 of file Message.cc.

◆ getAuthor_signature()

const optional< string > & Message::getAuthor_signature ( ) const

Definition at line 240 of file Message.cc.

◆ getCaption()

const optional< string > & Message::getCaption ( ) const

Definition at line 280 of file Message.cc.

◆ getChannel_chat_created()

const optional< bool > & Message::getChannel_chat_created ( ) const

Definition at line 324 of file Message.cc.

◆ getChat()

const Chat & Message::getChat ( ) const

Definition at line 208 of file Message.cc.

◆ getContact()

const optional< Contact > & Message::getContact ( ) const

Definition at line 284 of file Message.cc.

◆ getDate()

int32_t Message::getDate ( ) const

Definition at line 204 of file Message.cc.

◆ getDelete_chat_photo()

const optional< bool > & Message::getDelete_chat_photo ( ) const

Definition at line 312 of file Message.cc.

◆ getDocument()

const optional< Document > & Message::getDocument ( ) const

Definition at line 256 of file Message.cc.

◆ getEdit_date()

const optional< int32_t > & Message::getEdit_date ( ) const

Definition at line 236 of file Message.cc.

◆ getEntities()

const vector< MessageEntity > & Message::getEntities ( ) const

Definition at line 248 of file Message.cc.

◆ getForward_date()

const optional< int32_t > & Message::getForward_date ( ) const

Definition at line 228 of file Message.cc.

◆ getForward_from()

const optional< User > & Message::getForward_from ( ) const

Definition at line 212 of file Message.cc.

◆ getForward_from_chat()

const optional< Chat > & Message::getForward_from_chat ( ) const

Definition at line 216 of file Message.cc.

◆ getForward_from_message_id()

const optional< int32_t > & Message::getForward_from_message_id ( ) const

Definition at line 220 of file Message.cc.

◆ getForward_signature()

const optional< string > & Message::getForward_signature ( ) const

Definition at line 224 of file Message.cc.

◆ getFrom()

const optional< User > & Message::getFrom ( ) const

Definition at line 200 of file Message.cc.

◆ getGroup_chat_created()

const optional< bool > & Message::getGroup_chat_created ( ) const

Definition at line 316 of file Message.cc.

◆ getLeft_chat_member()

const optional< User > & Message::getLeft_chat_member ( ) const

Definition at line 300 of file Message.cc.

◆ getLocation()

const optional< Location > & Message::getLocation ( ) const

Definition at line 288 of file Message.cc.

◆ getMessage_id()

int32_t Message::getMessage_id ( ) const

Definition at line 196 of file Message.cc.

◆ getMigrate_from_chat_id()

const optional< long > & Message::getMigrate_from_chat_id ( ) const

Definition at line 332 of file Message.cc.

◆ getMigrate_to_chat_id()

const optional< long > & Message::getMigrate_to_chat_id ( ) const

Definition at line 328 of file Message.cc.

◆ getNew_chat_member()

const optional< User > & Message::getNew_chat_member ( ) const

Definition at line 296 of file Message.cc.

◆ getNew_chat_members()

const vector< User > & Message::getNew_chat_members ( ) const

Definition at line 276 of file Message.cc.

◆ getNew_chat_photo()

const vector< PhotoSize > & Message::getNew_chat_photo ( ) const

Definition at line 308 of file Message.cc.

◆ getNew_chat_title()

const optional< string > & Message::getNew_chat_title ( ) const

Definition at line 304 of file Message.cc.

◆ getPhoto()

const vector< PhotoSize > & Message::getPhoto ( ) const

Definition at line 260 of file Message.cc.

◆ getSupergroup_chat_created()

const optional< bool > & Message::getSupergroup_chat_created ( ) const

Definition at line 320 of file Message.cc.

◆ getText()

const optional< string > & Message::getText ( ) const

Definition at line 244 of file Message.cc.

◆ getVenue()

const optional< Venue > & Message::getVenue ( ) const

Definition at line 292 of file Message.cc.

◆ getVideo()

const optional< Video > & Message::getVideo ( ) const

Definition at line 264 of file Message.cc.

◆ getVideo_note()

const optional< VideoNote > & Message::getVideo_note ( ) const

Definition at line 272 of file Message.cc.

◆ getVoice()

const optional< Voice > & Message::getVoice ( ) const

Definition at line 268 of file Message.cc.

◆ setAudio()

void Message::setAudio ( const std::optional< Audio > &  audio)

Definition at line 104 of file Message.cc.

◆ setAuthor_signature()

void Message::setAuthor_signature ( const std::optional< std::string > &  author_signature)

Definition at line 92 of file Message.cc.

◆ setCaption()

void Message::setCaption ( const std::optional< std::string > &  caption)

Definition at line 136 of file Message.cc.

◆ setChannel_chat_created()

void Message::setChannel_chat_created ( const std::optional< bool > &  channel_chat_created)

Definition at line 180 of file Message.cc.

◆ setContact()

void Message::setContact ( const std::optional< Contact > &  contact)

Definition at line 140 of file Message.cc.

◆ setDelete_chat_photo()

void Message::setDelete_chat_photo ( const std::optional< bool > &  delete_chat_photo)

Definition at line 168 of file Message.cc.

◆ setDocument()

void Message::setDocument ( const std::optional< Document > &  document)

Definition at line 108 of file Message.cc.

◆ setEdit_date()

void Message::setEdit_date ( const std::optional< std::int32_t > &  edit_date)

Definition at line 88 of file Message.cc.

◆ setForward_date()

void Message::setForward_date ( const std::optional< std::int32_t > &  forward_date)

Definition at line 80 of file Message.cc.

◆ setForward_from()

void Message::setForward_from ( const std::optional< User > &  forward_from)

Definition at line 64 of file Message.cc.

◆ setForward_from_chat()

void Message::setForward_from_chat ( const std::optional< Chat > &  forward_from_chat)

Definition at line 68 of file Message.cc.

◆ setForward_from_message_id()

void Message::setForward_from_message_id ( const std::optional< std::int32_t > &  forward_from_message_id)

Definition at line 72 of file Message.cc.

◆ setForward_signature()

void Message::setForward_signature ( const std::optional< std::string > &  forward_signature)

Definition at line 76 of file Message.cc.

◆ setFrom()

void Message::setFrom ( const std::optional< User > &  from)

Definition at line 60 of file Message.cc.

◆ setGroup_chat_created()

void Message::setGroup_chat_created ( const std::optional< bool > &  group_chat_created)

Definition at line 172 of file Message.cc.

◆ setLeft_chat_member()

void Message::setLeft_chat_member ( const std::optional< User > &  left_chat_member)

Definition at line 156 of file Message.cc.

◆ setLocation()

void Message::setLocation ( const std::optional< Location > &  location)

Definition at line 144 of file Message.cc.

◆ setMigrate_from_chat_id()

void Message::setMigrate_from_chat_id ( const std::optional< long > &  migrate_from_chat_id)

Definition at line 188 of file Message.cc.

◆ setMigrate_to_chat_id()

void Message::setMigrate_to_chat_id ( const std::optional< long > &  migrate_to_chat_id)

Definition at line 184 of file Message.cc.

◆ setNew_chat_member()

void Message::setNew_chat_member ( const std::optional< User > &  new_chat_member)

Definition at line 152 of file Message.cc.

◆ setNew_chat_title()

void Message::setNew_chat_title ( const std::optional< std::string > &  new_chat_title)

Definition at line 160 of file Message.cc.

◆ setSupergroup_chat_created()

void Message::setSupergroup_chat_created ( const std::optional< bool > &  supergroup_chat_created)

Definition at line 176 of file Message.cc.

◆ setText()

void Message::setText ( const std::optional< std::string > &  text)

Definition at line 96 of file Message.cc.

◆ setVenue()

void Message::setVenue ( const std::optional< Venue > &  venue)

Definition at line 148 of file Message.cc.

◆ setVideo()

void Message::setVideo ( const std::optional< Video > &  video)

Definition at line 120 of file Message.cc.

◆ setVideo_note()

void Message::setVideo_note ( const std::optional< VideoNote > &  video_note)

Definition at line 128 of file Message.cc.

◆ setVoice()

void Message::setVoice ( const std::optional< Voice > &  voice)

Definition at line 124 of file Message.cc.

Member Data Documentation

◆ audio

std::optional<Audio> yatbcpp::Message::audio
private

Optional. Message is an audio file, information about the file

Definition at line 193 of file Message.h.

◆ author_signature

std::optional<std::string> yatbcpp::Message::author_signature
private

Optional. Signature of the post author for messages in channels

Definition at line 187 of file Message.h.

◆ caption

std::optional<std::string> yatbcpp::Message::caption
private

Optional. Caption for the document, photo or video, 0-200 characters

Definition at line 207 of file Message.h.

◆ channel_chat_created

std::optional<bool> yatbcpp::Message::channel_chat_created
private

Optional. Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

Definition at line 229 of file Message.h.

◆ chat

Chat yatbcpp::Message::chat
private

onversation the message belongs to

Definition at line 171 of file Message.h.

◆ contact

std::optional<Contact> yatbcpp::Message::contact
private

Optional. Message is a shared contact, information about the contact

Definition at line 209 of file Message.h.

◆ date

std::int32_t yatbcpp::Message::date
private

Date the message was sent in Unix time

Definition at line 169 of file Message.h.

◆ delete_chat_photo

std::optional<bool> yatbcpp::Message::delete_chat_photo
private

Optional. Service message: the chat photo was deleted

Definition at line 223 of file Message.h.

◆ document

std::optional<Document> yatbcpp::Message::document
private

Optional. Message is a general file, information about the file

Definition at line 195 of file Message.h.

◆ edit_date

std::optional<std::int32_t> yatbcpp::Message::edit_date
private

Optional. Date the message was last edited in Unix time

Definition at line 185 of file Message.h.

◆ entities

std::vector<MessageEntity> yatbcpp::Message::entities
private

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

Definition at line 191 of file Message.h.

◆ forward_date

std::optional<std::int32_t> yatbcpp::Message::forward_date
private

Optional. For forwarded messages, date the original message was sent in Unix time

Definition at line 181 of file Message.h.

◆ forward_from

std::optional<User> yatbcpp::Message::forward_from
private

Optional. For forwarded messages, sender of the original message

Definition at line 173 of file Message.h.

◆ forward_from_chat

std::optional<Chat> yatbcpp::Message::forward_from_chat
private

Optional. For messages forwarded from channels, information about the original channel

Definition at line 175 of file Message.h.

◆ forward_from_message_id

std::optional<std::int32_t> yatbcpp::Message::forward_from_message_id
private

Optional. For messages forwarded from channels, identifier of the original message in the channel

Definition at line 177 of file Message.h.

◆ forward_signature

std::optional<std::string> yatbcpp::Message::forward_signature
private

Optional. For messages forwarded from channels, signature of the post author if present

Definition at line 179 of file Message.h.

◆ from

std::optional<User> yatbcpp::Message::from
private

Optional. Sender, empty for messages sent to channels

Definition at line 167 of file Message.h.

◆ group_chat_created

std::optional<bool> yatbcpp::Message::group_chat_created
private

Optional. Service message: the group has been created

Definition at line 225 of file Message.h.

◆ left_chat_member

std::optional<User> yatbcpp::Message::left_chat_member
private

Optional. A member was removed from the group, information about them (this member may be the bot itself)

Definition at line 217 of file Message.h.

◆ location

std::optional<Location> yatbcpp::Message::location
private

Optional. Message is a shared location, information about the location

Definition at line 211 of file Message.h.

◆ message_id

std::int32_t yatbcpp::Message::message_id
private

Unique message identifier inside this chat

Definition at line 165 of file Message.h.

◆ migrate_from_chat_id

std::optional<long> yatbcpp::Message::migrate_from_chat_id
private

Optional. The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

Definition at line 233 of file Message.h.

◆ migrate_to_chat_id

std::optional<long> yatbcpp::Message::migrate_to_chat_id
private

Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

Definition at line 231 of file Message.h.

◆ new_chat_member

std::optional<User> yatbcpp::Message::new_chat_member
private

Optional. A new member was added to the group, information about them (this member may be the bot itself)

Definition at line 215 of file Message.h.

◆ new_chat_members

std::vector<User> yatbcpp::Message::new_chat_members
private

Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

Definition at line 205 of file Message.h.

◆ new_chat_photo

std::vector<PhotoSize> yatbcpp::Message::new_chat_photo
private

Optional. A chat photo was change to this value

Definition at line 221 of file Message.h.

◆ new_chat_title

std::optional<std::string> yatbcpp::Message::new_chat_title
private

Optional. A chat title was changed to this value

Definition at line 219 of file Message.h.

◆ photo

std::vector<PhotoSize> yatbcpp::Message::photo
private

Optional. Message is a photo, available sizes of the photo

Definition at line 197 of file Message.h.

◆ supergroup_chat_created

std::optional<bool> yatbcpp::Message::supergroup_chat_created
private

Optional. Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

Definition at line 227 of file Message.h.

◆ text

std::optional<std::string> yatbcpp::Message::text
private

Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters.

Definition at line 189 of file Message.h.

◆ venue

std::optional<Venue> yatbcpp::Message::venue
private

Optional. Message is a venue, information about the venue

Definition at line 213 of file Message.h.

◆ video

std::optional<Video> yatbcpp::Message::video
private

Optional. Message is a video, information about the video

Definition at line 199 of file Message.h.

◆ video_note

std::optional<VideoNote> yatbcpp::Message::video_note
private

Optional. Message is a video note, information about the video message

Definition at line 203 of file Message.h.

◆ voice

std::optional<Voice> yatbcpp::Message::voice
private

Optional. Message is a voice message, information about the file

Definition at line 201 of file Message.h.


The documentation for this class was generated from the following files: