tgbot-cpp
Loading...
Searching...
No Matches
TgBot::Chat Class Reference

This object represents a chat. More...

#include <Chat.h>

Public Types

enum class  Type { Private , Group , Supergroup , Channel }
 Enum of possible types of a chat. More...
 
typedef std::shared_ptr< ChatPtr
 

Public Attributes

std::int64_t id
 Unique identifier for this chat.
 
Type type
 Type of chat, can be either “private”, “group”, “supergroup” or “channel”
 
std::string title
 Optional. Title, for supergroups, channels and group chats.
 
std::string username
 Optional. Username, for private chats, supergroups and channels if available.
 
std::string firstName
 Optional. First name of the other party in a private chat.
 
std::string lastName
 Optional. Last name of the other party in a private chat.
 
bool isForum
 Optional. True, if the supergroup chat is a forum (has topics enabled)
 
ChatPhoto::Ptr photo
 Optional. Chat photo.
 
std::vector< std::string > activeUsernames
 Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels.
 
Birthdate::Ptr birthdate
 Optional. For private chats, the date of birth of the user.
 
BusinessIntro::Ptr businessIntro
 Optional. For private chats with business accounts, the intro of the business.
 
BusinessLocation::Ptr businessLocation
 Optional. For private chats with business accounts, the location of the business.
 
BusinessOpeningHours::Ptr businessOpeningHours
 Optional. For private chats with business accounts, the opening hours of the business.
 
Chat::Ptr personalChat
 Optional. For private chats, the personal channel of the user.
 
std::vector< ReactionType::PtravailableReactions
 Optional. List of available reactions allowed in the chat.
 
std::int32_t accentColorId
 Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview.
 
std::string backgroundCustomEmojiId
 Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background.
 
std::int32_t profileAccentColorId
 Optional. Identifier of the accent color for the chat's profile background.
 
std::string profileBackgroundCustomEmojiId
 Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background.
 
std::string emojiStatusCustomEmojiId
 Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat.
 
std::uint32_t emojiStatusExpirationDate
 Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any.
 
std::string bio
 Optional. Bio of the other party in a private chat.
 
bool hasPrivateForwards
 Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user.
 
bool hasRestrictedVoiceAndVideoMessages
 Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat.
 
bool joinToSendMessages
 Optional. True, if users need to join the supergroup before they can send messages.
 
bool joinByRequest
 Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators.
 
std::string description
 Optional. Description, for groups, supergroups and channel chats.
 
std::string inviteLink
 Optional. Primary invite link, for groups, supergroups and channel chats.
 
std::shared_ptr< MessagepinnedMessage
 Optional. The most recent pinned message (by sending date).
 
ChatPermissions::Ptr permissions
 Optional. Default chat member permissions, for groups and supergroups.
 
std::int32_t slowModeDelay
 Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds.
 
std::int32_t unrestrictBoostCount
 Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions.
 
std::int32_t messageAutoDeleteTime
 Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds.
 
bool hasAggressiveAntiSpamEnabled
 Optional. True, if aggressive anti-spam checks are enabled in the supergroup.
 
bool hasHiddenMembers
 Optional. True, if non-administrators can only get the list of bots and administrators in the chat.
 
bool hasProtectedContent
 Optional. True, if messages from the chat can't be forwarded to other chats.
 
bool hasVisibleHistory
 Optional. True, if new chat members will have access to old messages; available only to chat administrators.
 
std::string stickerSetName
 Optional. For supergroups, name of group sticker set.
 
bool canSetStickerSet
 Optional. True, if the bot can change the group sticker set.
 
std::string customEmojiStickerSetName
 Optional. For supergroups, the name of the group's custom emoji sticker set.
 
std::int64_t linkedChatId
 Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats.
 
ChatLocation::Ptr location
 Optional. For supergroups, the location to which the supergroup is connected.
 

Detailed Description

This object represents a chat.

Definition at line 28 of file Chat.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Chat> TgBot::Chat::Ptr

Definition at line 31 of file Chat.h.

Member Enumeration Documentation

◆ Type

enum class TgBot::Chat::Type
strong

Enum of possible types of a chat.

Enumerator
Private 
Group 
Supergroup 
Channel 

Definition at line 36 of file Chat.h.

Member Data Documentation

◆ accentColorId

std::int32_t TgBot::Chat::accentColorId

Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview.

See accent colors for more details. Returned only in Api::getChat. Always returned in Api::getChat.

Definition at line 142 of file Chat.h.

◆ activeUsernames

std::vector<std::string> TgBot::Chat::activeUsernames

Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels.

Returned only in Api::getChat.

Definition at line 90 of file Chat.h.

◆ availableReactions

std::vector<ReactionType::Ptr> TgBot::Chat::availableReactions

Optional. List of available reactions allowed in the chat.

If omitted, then all emoji reactions are allowed. Returned only in Api::getChat.

Definition at line 133 of file Chat.h.

◆ backgroundCustomEmojiId

std::string TgBot::Chat::backgroundCustomEmojiId

Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background.

Returned only in Api::getChat.

Definition at line 149 of file Chat.h.

◆ bio

std::string TgBot::Chat::bio

Optional. Bio of the other party in a private chat.

Returned only in Api::getChat.

Definition at line 185 of file Chat.h.

◆ birthdate

Birthdate::Ptr TgBot::Chat::birthdate

Optional. For private chats, the date of birth of the user.

Returned only in Api::getChat.

Definition at line 97 of file Chat.h.

◆ businessIntro

BusinessIntro::Ptr TgBot::Chat::businessIntro

Optional. For private chats with business accounts, the intro of the business.

Returned only in Api::getChat.

Definition at line 104 of file Chat.h.

◆ businessLocation

BusinessLocation::Ptr TgBot::Chat::businessLocation

Optional. For private chats with business accounts, the location of the business.

Returned only in Api::getChat.

Definition at line 111 of file Chat.h.

◆ businessOpeningHours

BusinessOpeningHours::Ptr TgBot::Chat::businessOpeningHours

Optional. For private chats with business accounts, the opening hours of the business.

Returned only in Api::getChat.

Definition at line 118 of file Chat.h.

◆ canSetStickerSet

bool TgBot::Chat::canSetStickerSet

Optional. True, if the bot can change the group sticker set.

Returned only in Api::getChat.

Definition at line 305 of file Chat.h.

◆ customEmojiStickerSetName

std::string TgBot::Chat::customEmojiStickerSetName

Optional. For supergroups, the name of the group's custom emoji sticker set.

Custom emoji from this set can be used by all users and bots in the group. Returned only in Api::getChat.

Definition at line 313 of file Chat.h.

◆ description

std::string TgBot::Chat::description

Optional. Description, for groups, supergroups and channel chats.

Returned only in Api::getChat.

Definition at line 220 of file Chat.h.

◆ emojiStatusCustomEmojiId

std::string TgBot::Chat::emojiStatusCustomEmojiId

Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat.

Returned only in Api::getChat.

Definition at line 171 of file Chat.h.

◆ emojiStatusExpirationDate

std::uint32_t TgBot::Chat::emojiStatusExpirationDate

Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any.

Returned only in Api::getChat.

Definition at line 178 of file Chat.h.

◆ firstName

std::string TgBot::Chat::firstName

Optional. First name of the other party in a private chat.

Definition at line 66 of file Chat.h.

◆ hasAggressiveAntiSpamEnabled

bool TgBot::Chat::hasAggressiveAntiSpamEnabled

Optional. True, if aggressive anti-spam checks are enabled in the supergroup.

The field is only available to chat administrators. Returned only in Api::getChat.

Definition at line 270 of file Chat.h.

◆ hasHiddenMembers

bool TgBot::Chat::hasHiddenMembers

Optional. True, if non-administrators can only get the list of bots and administrators in the chat.

Returned only in Api::getChat.

Definition at line 277 of file Chat.h.

◆ hasPrivateForwards

bool TgBot::Chat::hasPrivateForwards

Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user.

Returned only in Api::getChat.

Definition at line 192 of file Chat.h.

◆ hasProtectedContent

bool TgBot::Chat::hasProtectedContent

Optional. True, if messages from the chat can't be forwarded to other chats.

Returned only in Api::getChat.

Definition at line 284 of file Chat.h.

◆ hasRestrictedVoiceAndVideoMessages

bool TgBot::Chat::hasRestrictedVoiceAndVideoMessages

Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat.

Returned only in Api::getChat.

Definition at line 199 of file Chat.h.

◆ hasVisibleHistory

bool TgBot::Chat::hasVisibleHistory

Optional. True, if new chat members will have access to old messages; available only to chat administrators.

Returned only in Api::getChat.

Definition at line 291 of file Chat.h.

◆ id

std::int64_t TgBot::Chat::id

Unique identifier for this chat.

This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

Definition at line 46 of file Chat.h.

◆ inviteLink

std::string TgBot::Chat::inviteLink

Optional. Primary invite link, for groups, supergroups and channel chats.

Returned only in Api::getChat.

Definition at line 227 of file Chat.h.

◆ isForum

bool TgBot::Chat::isForum

Optional. True, if the supergroup chat is a forum (has topics enabled)

Definition at line 76 of file Chat.h.

◆ joinByRequest

bool TgBot::Chat::joinByRequest

Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators.

Returned only in Api::getChat.

Definition at line 213 of file Chat.h.

◆ joinToSendMessages

bool TgBot::Chat::joinToSendMessages

Optional. True, if users need to join the supergroup before they can send messages.

Returned only in Api::getChat.

Definition at line 206 of file Chat.h.

◆ lastName

std::string TgBot::Chat::lastName

Optional. Last name of the other party in a private chat.

Definition at line 71 of file Chat.h.

◆ linkedChatId

std::int64_t TgBot::Chat::linkedChatId

Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats.

This identifier 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. Returned only in Api::getChat.

Definition at line 322 of file Chat.h.

◆ location

ChatLocation::Ptr TgBot::Chat::location

Optional. For supergroups, the location to which the supergroup is connected.

Returned only in Api::getChat.

Definition at line 329 of file Chat.h.

◆ messageAutoDeleteTime

std::int32_t TgBot::Chat::messageAutoDeleteTime

Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds.

Returned only in Api::getChat.

Definition at line 262 of file Chat.h.

◆ permissions

ChatPermissions::Ptr TgBot::Chat::permissions

Optional. Default chat member permissions, for groups and supergroups.

Returned only in Api::getChat.

Definition at line 241 of file Chat.h.

◆ personalChat

Chat::Ptr TgBot::Chat::personalChat

Optional. For private chats, the personal channel of the user.

Returned only in Api::getChat.

Definition at line 125 of file Chat.h.

◆ photo

ChatPhoto::Ptr TgBot::Chat::photo

Optional. Chat photo.

Returned only in Api::getChat.

Definition at line 83 of file Chat.h.

◆ pinnedMessage

std::shared_ptr<Message> TgBot::Chat::pinnedMessage

Optional. The most recent pinned message (by sending date).

Returned only in Api::getChat.

Definition at line 234 of file Chat.h.

◆ profileAccentColorId

std::int32_t TgBot::Chat::profileAccentColorId

Optional. Identifier of the accent color for the chat's profile background.

See profile accent colors for more details. Returned only in Api::getChat.

Definition at line 157 of file Chat.h.

◆ profileBackgroundCustomEmojiId

std::string TgBot::Chat::profileBackgroundCustomEmojiId

Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background.

Returned only in Api::getChat.

Definition at line 164 of file Chat.h.

◆ slowModeDelay

std::int32_t TgBot::Chat::slowModeDelay

Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds.

Returned only in Api::getChat.

Definition at line 248 of file Chat.h.

◆ stickerSetName

std::string TgBot::Chat::stickerSetName

Optional. For supergroups, name of group sticker set.

Returned only in Api::getChat.

Definition at line 298 of file Chat.h.

◆ title

std::string TgBot::Chat::title

Optional. Title, for supergroups, channels and group chats.

Definition at line 56 of file Chat.h.

◆ type

Type TgBot::Chat::type

Type of chat, can be either “private”, “group”, “supergroup” or “channel”

Definition at line 51 of file Chat.h.

◆ unrestrictBoostCount

std::int32_t TgBot::Chat::unrestrictBoostCount

Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions.

Returned only in Api::getChat.

Definition at line 255 of file Chat.h.

◆ username

std::string TgBot::Chat::username

Optional. Username, for private chats, supergroups and channels if available.

Definition at line 61 of file Chat.h.


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