diff options
author | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-09-04 13:45:21 +0200 |
---|---|---|
committer | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-09-04 13:45:21 +0200 |
commit | bfa7b0c67a3df3848eb7f9bccdf7c158ce4c9d07 (patch) | |
tree | e8976cfee6f7daf34ab511266fa38b649aec0dcc /include/tgbot | |
parent | c17ab6fb6574bdea6fc9011be0651dc74aa6a53e (diff) |
Update to API 5.1
Diffstat (limited to 'include/tgbot')
-rw-r--r-- | include/tgbot/Api.h | 93 | ||||
-rw-r--r-- | include/tgbot/TgTypeParser.h | 23 | ||||
-rw-r--r-- | include/tgbot/types/ChatInviteLink.h | 55 | ||||
-rw-r--r-- | include/tgbot/types/ChatMember.h | 11 | ||||
-rw-r--r-- | include/tgbot/types/ChatMemberUpdated.h | 55 | ||||
-rw-r--r-- | include/tgbot/types/Dice.h | 2 | ||||
-rw-r--r-- | include/tgbot/types/Message.h | 54 | ||||
-rw-r--r-- | include/tgbot/types/MessageAutoDeleteTimerChanged.h | 26 | ||||
-rw-r--r-- | include/tgbot/types/Update.h | 15 | ||||
-rw-r--r-- | include/tgbot/types/VoiceChatEnded.h | 26 | ||||
-rw-r--r-- | include/tgbot/types/VoiceChatParticipantsInvited.h | 28 | ||||
-rw-r--r-- | include/tgbot/types/VoiceChatStarted.h | 21 |
12 files changed, 381 insertions, 28 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index 2241e1d..cf4cd31 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -560,7 +560,7 @@ public: * @brief Use this method to send an animated emoji that will display a random value. * * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @param emoji Optional. Emoji on which the dice throw animation is based. Currently, must be one of βπ²β, βπ―β, βπβ, ββ½β, or βπ°β. Dice can have values 1-6 for βπ²β and βπ―β, values 1-5 for βπβ and ββ½β, and values 1-64 for βπ°β. Defaults to βπ²β + * @param emoji Optional. Emoji on which the dice throw animation is based. Currently, must be one of βπ²β, βπ―β, βπβ, ββ½β, βπ³β, or βπ°β. Dice can have values 1-6 for βπ²β, βπ―β and βπ³β, values 1-5 for βπβ and ββ½β, and values 1-64 for βπ°β. Defaults to βπ²β * @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound. * @param replyToMessageId Optional. If the message is a reply, ID of the original message * @param allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found @@ -611,13 +611,21 @@ public: std::string downloadFile(const std::string& filePath, const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>()) const; /** - * @brief Use this method to kick a user from a group or a supergroup. - * @param chatId Unique identifier for the target group. - * @param userId Unique identifier of the target user. - * @param untilDate Optional. Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. - * @return True on success + * @brief Use this method to kick a user from a group, a supergroup or a channel. + * In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. + * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * + * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) + * @param userId Unique identifier of the target user + * @param untilDate Optional. Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. + * @param revokeMessages Optional. Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. + * + * @return True on success. */ - bool kickChatMember(std::int64_t chatId, std::int64_t userId, std::uint64_t untilDate = 0) const; + bool kickChatMember(std::int64_t chatId, + std::int64_t userId, + std::uint64_t untilDate = 0, + bool revokeMessages = true) const; /** * @brief Use this method to unban a previously kicked user in a supergroup or channel. @@ -657,21 +665,32 @@ public: * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername) * @param userId Unique identifier of the target user * @param isAnonymous Optional. Pass True, if the administrator's presence in the chat is hidden - * @param canChangeInfo Optional. Pass True, if the administrator can change chat title, photo and other settings + * @param canManageChat Optional. Pass True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege * @param canPostMessages Optional. Pass True, if the administrator can create channel posts, channels only - * @param canEditMessages Optional. Pass True, if the administrator can edit messages of other users and can pin messages, channels only + * @param canEditMessages Optional. Pass True, if the administrator can edit messages of other users and can pin messages, channels only * @param canDeleteMessages Optional. Pass True, if the administrator can delete messages of other users - * @param canInviteUsers Optional. Pass True, if the administrator can invite new users to the chat + * @param canManageVoiceChats Optional. Pass True, if the administrator can manage voice chats, supergroups only * @param canRestrictMembers Optional. Pass True, if the administrator can restrict, ban or unban chat members - * @param canPinMessages Optional. Pass True, if the administrator can pin messages, supergroups only * @param canPromoteMembers Optional. Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) + * @param canChangeInfo Optional. Pass True, if the administrator can change chat title, photo and other settings + * @param canInviteUsers Optional. Pass True, if the administrator can invite new users to the chat + * @param canPinMessages Optional. Pass True, if the administrator can pin messages, supergroups only * * @return True on success. */ - bool promoteChatMember(std::int64_t chatId, std::int64_t userId, bool isAnonymous = false, - bool canChangeInfo = false, bool canPostMessages = false, bool canEditMessages = false, - bool canDeleteMessages = false, bool canInviteUsers = false, bool canRestrictMembers = false, - bool canPinMessages = false, bool canPromoteMembers = false) const; + bool promoteChatMember(std::int64_t chatId, + std::int64_t userId, + bool isAnonymous = false, + bool canManageChat = false, + bool canPostMessages = false, + bool canEditMessages = false, + bool canDeleteMessages = false, + bool canManageVoiceChats = false, + bool canRestrictMembers = false, + bool canPromoteMembers = false, + bool canChangeInfo = false, + bool canInviteUsers = false, + bool canPinMessages = false) const; /** * @brief Use this method to set a custom title for an administrator in a supergroup promoted by the bot. @@ -700,6 +719,50 @@ public: std::string exportChatInviteLink(std::int64_t chatId) const; /** + * @brief Use this method to create an additional invite link for a chat. + * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * The link can be revoked using the method Api::revokeChatInviteLink. + * + * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * @param expireDate Optional. Point in time (Unix timestamp) when the link will expire + * @param memberLimit Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 + * + * @return the new invite link as ChatInviteLink object. + */ + ChatInviteLink::Ptr createChatInviteLink(std::int64_t chatId, + std::int32_t expireDate = 0, + std::int32_t memberLimit = 0) const; + + /** + * @brief Use this method to edit a non-primary invite link created by the bot. + * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * + * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * @param inviteLink The invite link to edit + * @param expireDate Optional. Point in time (Unix timestamp) when the link will expire + * @param memberLimit Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 + * + * @return the edited invite link as a ChatInviteLink object. + */ + ChatInviteLink::Ptr editChatInviteLink(std::int64_t chatId, + std::string inviteLink, + std::int32_t expireDate = 0, + std::int32_t memberLimit = 0) const; + + /** + * @brief Use this method to revoke an invite link created by the bot. + * If the primary link is revoked, a new link is automatically generated. + * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * + * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * @param inviteLink The invite link to revoke + * + * @return the revoked invite link as ChatInviteLink object. + */ + ChatInviteLink::Ptr revokeChatInviteLink(std::int64_t chatId, + std::string inviteLink) const; + + /** * @brief Use this method to set a new profile photo for the chat. * * Photos can't be changed for private chats. diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h index 7009f6e..86f3b31 100644 --- a/include/tgbot/TgTypeParser.h +++ b/include/tgbot/TgTypeParser.h @@ -24,6 +24,10 @@ #include "tgbot/types/Contact.h" #include "tgbot/types/Location.h" #include "tgbot/types/ProximityAlertTriggered.h" +#include "tgbot/types/MessageAutoDeleteTimerChanged.h" +#include "tgbot/types/VoiceChatStarted.h" +#include "tgbot/types/VoiceChatEnded.h" +#include "tgbot/types/VoiceChatParticipantsInvited.h" #include "tgbot/types/Update.h" #include "tgbot/types/UserProfilePhotos.h" #include "tgbot/types/File.h" @@ -33,6 +37,7 @@ #include "tgbot/types/ReplyKeyboardRemove.h" #include "tgbot/types/ForceReply.h" #include "tgbot/types/ChatMember.h" +#include "tgbot/types/ChatMemberUpdated.h" #include "tgbot/types/ChatPhoto.h" #include "tgbot/types/ResponseParameters.h" #include "tgbot/types/GenericReply.h" @@ -201,6 +206,18 @@ public: ProximityAlertTriggered::Ptr parseJsonAndGetProximityAlertTriggered(const boost::property_tree::ptree& data) const; std::string parseProximityAlertTriggered(const ProximityAlertTriggered::Ptr& object) const; + MessageAutoDeleteTimerChanged::Ptr parseJsonAndGetMessageAutoDeleteTimerChanged(const boost::property_tree::ptree& data) const; + std::string parseMessageAutoDeleteTimerChanged(const MessageAutoDeleteTimerChanged::Ptr& object) const; + + VoiceChatStarted::Ptr parseJsonAndGetVoiceChatStarted(const boost::property_tree::ptree& data) const; + std::string parseVoiceChatStarted(const VoiceChatStarted::Ptr& object) const; + + VoiceChatEnded::Ptr parseJsonAndGetVoiceChatEnded(const boost::property_tree::ptree& data) const; + std::string parseVoiceChatEnded(const VoiceChatEnded::Ptr& object) const; + + VoiceChatParticipantsInvited::Ptr parseJsonAndGetVoiceChatParticipantsInvited(const boost::property_tree::ptree& data) const; + std::string parseVoiceChatParticipantsInvited(const VoiceChatParticipantsInvited::Ptr& object) const; + Update::Ptr parseJsonAndGetUpdate(const boost::property_tree::ptree& data) const; std::string parseUpdate(const Update::Ptr& object) const; @@ -246,9 +263,15 @@ public: ChatMember::Ptr parseJsonAndGetChatMember(const boost::property_tree::ptree& data) const; std::string parseChatMember(const ChatMember::Ptr& object) const; + ChatMemberUpdated::Ptr parseJsonAndGetChatMemberUpdated(const boost::property_tree::ptree& data) const; + std::string parseChatMemberUpdated(const ChatMemberUpdated::Ptr& object) const; + ChatPhoto::Ptr parseJsonAndGetChatPhoto(const boost::property_tree::ptree& data) const; std::string parseChatPhoto(const ChatPhoto::Ptr& object) const; + ChatInviteLink::Ptr parseJsonAndGetChatInviteLink(const boost::property_tree::ptree& data) const; + std::string parseChatInviteLink(const ChatInviteLink::Ptr& object) const; + ResponseParameters::Ptr parseJsonAndGetResponseParameters(const boost::property_tree::ptree& data) const; std::string parseResponseParameters(const ResponseParameters::Ptr& object) const; diff --git a/include/tgbot/types/ChatInviteLink.h b/include/tgbot/types/ChatInviteLink.h new file mode 100644 index 0000000..22de714 --- /dev/null +++ b/include/tgbot/types/ChatInviteLink.h @@ -0,0 +1,55 @@ +#ifndef TGBOT_CPP_CHATINVITELINK_H +#define TGBOT_CPP_CHATINVITELINK_H + +#include "tgbot/types/User.h" + +#include <cstdint> +#include <memory> +#include <string> + +namespace TgBot { + +/** + * @brief Represents an invite link for a chat. + * + * @ingroup types + */ +class ChatInviteLink { + +public: + typedef std::shared_ptr<ChatInviteLink> Ptr; + + /** + * @brief The invite link. + * If the link was created by another chat administrator, then the second part of the link will be replaced with ββ¦β. + */ + std::string inviteLink; + + /** + * @brief Creator of the link + */ + User::Ptr creator; + + /** + * @brief True, if the link is primary + */ + bool isPrimary; + + /** + * @brief True, if the link is revoked + */ + bool isRevoked; + + /** + * @brief Optional. Point in time (Unix timestamp) when the link will expire or has been expired + */ + std::uint32_t expireDate; + + /** + * @brief Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 + */ + std::uint32_t memberLimit; +}; +} + +#endif //TGBOT_CPP_CHATINVITELINK_H diff --git a/include/tgbot/types/ChatMember.h b/include/tgbot/types/ChatMember.h index dd033fd..a7ef856 100644 --- a/include/tgbot/types/ChatMember.h +++ b/include/tgbot/types/ChatMember.h @@ -46,6 +46,12 @@ public: bool canBeEdited; /** + * @brief Optional. Administrators only. True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. + * Implied by any other administrator privilege + */ + bool canManageChat; + + /** * @brief Optional. Administrators only. True, if the administrator can post in the channel; channels only */ bool canPostMessages; @@ -61,6 +67,11 @@ public: bool canDeleteMessages; /** + * @brief Optional. Administrators only. True, if the administrator can manage voice chats + */ + bool canManageVoiceChats; + + /** * @brief Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members */ bool canRestrictMembers; diff --git a/include/tgbot/types/ChatMemberUpdated.h b/include/tgbot/types/ChatMemberUpdated.h new file mode 100644 index 0000000..9d8ce2b --- /dev/null +++ b/include/tgbot/types/ChatMemberUpdated.h @@ -0,0 +1,55 @@ +#ifndef TGBOT_CPP_CHATMEMBERUPDATED_H +#define TGBOT_CPP_CHATMEMBERUPDATED_H + +#include "tgbot/types/Chat.h" +#include "tgbot/types/User.h" +#include "tgbot/types/ChatMember.h" +#include "tgbot/types/ChatInviteLink.h" + +#include <memory> + +namespace TgBot { + +/** + * @brief This object represents changes in the status of a chat member. + * + * @ingroup types + */ +class ChatMemberUpdated { + +public: + typedef std::shared_ptr<ChatMemberUpdated> Ptr; + + /** + * @brief Chat the user belongs to + */ + Chat::Ptr chat; + + /** + * @brief Performer of the action, which resulted in the change + */ + User::Ptr from; + + /** + * @brief Date the change was done in Unix time + */ + std::uint32_t date; + + /** + * @brief Previous information about the chat member + */ + ChatMember::Ptr oldChatMember; + + /** + * @brief New information about the chat member + */ + ChatMember::Ptr newChatMember; + + /** + * @brief Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. + */ + ChatInviteLink::Ptr inviteLink; +}; +} + +#endif //TGBOT_CPP_CHATMEMBERUPDATED_H diff --git a/include/tgbot/types/Dice.h b/include/tgbot/types/Dice.h index 55ded96..58a97f5 100644 --- a/include/tgbot/types/Dice.h +++ b/include/tgbot/types/Dice.h @@ -21,7 +21,7 @@ public: std::string emoji; /** - * @brief Value of the dice, 1-6 for βπ²β and βπ―β base emoji, 1-5 for βπβ and ββ½β base emoji, 1-64 for βπ°β base emoji + * @brief Value of the dice, 1-6 for βπ²β, βπ―β and βπ³β base emoji, 1-5 for βπβ and ββ½β base emoji, 1-64 for βπ°β base emoji */ std::int32_t value; }; diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h index 7eb28d7..fc99873 100644 --- a/include/tgbot/types/Message.h +++ b/include/tgbot/types/Message.h @@ -19,10 +19,14 @@ #include "tgbot/types/Venue.h" #include "tgbot/types/Voice.h" #include "tgbot/types/VideoNote.h" +#include "tgbot/types/MessageAutoDeleteTimerChanged.h" #include "tgbot/types/Invoice.h" #include "tgbot/types/SuccessfulPayment.h" #include "tgbot/types/PassportData.h" #include "tgbot/types/ProximityAlertTriggered.h" +#include "tgbot/types/VoiceChatStarted.h" +#include "tgbot/types/VoiceChatEnded.h" +#include "tgbot/types/VoiceChatParticipantsInvited.h" #include "tgbot/types/InlineKeyboardMarkup.h" #include <cstdint> @@ -75,7 +79,7 @@ public: User::Ptr forwardFrom; /** - * @brief Optional. For messages forwarded from channels, information about the original channel + * @brief Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat */ Chat::Ptr forwardFromChat; @@ -101,7 +105,7 @@ public: /** * @brief Optional. For replies, the original message. - * Note that the Message object in this field will not contain further @ref Message::replyToMessage fields even if it itself is a reply. + * Note that the Message object in this field will not contain further replyToMessage fields even if it itself is a reply. */ Message::Ptr replyToMessage; @@ -192,7 +196,7 @@ public: Contact::Ptr contact; /** - * @brief Optional. Message is a dice with random value from 1 to 6 + * @brief Optional. Message is a dice with random value */ Dice::Ptr dice; @@ -207,7 +211,8 @@ public: Poll::Ptr poll; /** - * @brief Optional. Message is a venue, information about the venue + * @brief Optional. Message is a venue, information about the venue. + * For backward compatibility, when this field is set, the location field will also be set */ Venue::Ptr venue; @@ -217,7 +222,7 @@ public: Location::Ptr location; /** - * @brief Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) + * @brief Optional. Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */ std::vector<User::Ptr> newChatMembers; @@ -247,16 +252,25 @@ public: bool groupChatCreated; /** - * @brief Optional. Service message: the supergroup has been created + * @brief 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 replyToMessage if someone replies to a very first message in a directly created supergroup. */ bool supergroupChatCreated; /** - * @brief Optional. Service message: the channel has been created + * @brief 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 replyToMessage if someone replies to a very first message in a channel. */ bool channelChatCreated; /** + * @brief Optional. Service message: auto-delete timer settings changed in the chat + */ + MessageAutoDeleteTimerChanged::Ptr messageAutoDeleteTimerChanged; + + /** * @brief 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. @@ -274,22 +288,25 @@ public: /** * @brief Optional. Specified message was pinned. - * Note that the Message object in this field will not contain further @ref Message::replyToMessage fields even if it is itself a reply. + * Note that the Message object in this field will not contain further replyToMessage fields even if it is itself a reply. */ Message::Ptr pinnedMessage; /** - * @brief Optional. Message is an invoice for a payment, information about the invoice + * @brief Optional. Message is an invoice for a payment, information about the invoice. + * https://core.telegram.org/bots/api#payments */ Invoice::Ptr invoice; /** * @brief Optional. Message is a service message about a successful payment, information about the payment + * https://core.telegram.org/bots/api#payments */ SuccessfulPayment::Ptr successfulPayment; /** - * @brief Optional. The domain name of the website on which the user has logged in + * @brief Optional. The domain name of the website on which the user has logged in. + * https://core.telegram.org/widgets/login */ std::string connectedWebsite; @@ -305,8 +322,23 @@ public: ProximityAlertTriggered::Ptr proximityAlertTriggered; /** + * @brief Optional. Service message: voice chat started + */ + VoiceChatStarted::Ptr voiceChatStarted; + + /** + * @brief Optional. Service message: voice chat ended + */ + VoiceChatEnded::Ptr voiceChatEnded; + + /** + * @brief Optional. Service message: new participants invited to a voice chat + */ + VoiceChatParticipantsInvited::Ptr voiceChatParticipantsInvited; + + /** * @brief Optional. Inline keyboard attached to the message. - * @ref InlineKeyboardButton::loginUrl buttons are represented as ordinary @ref InlineKeyboardButton::url buttons. + * loginUrl buttons are represented as ordinary url buttons. */ InlineKeyboardMarkup::Ptr replyMarkup; diff --git a/include/tgbot/types/MessageAutoDeleteTimerChanged.h b/include/tgbot/types/MessageAutoDeleteTimerChanged.h new file mode 100644 index 0000000..87adcd5 --- /dev/null +++ b/include/tgbot/types/MessageAutoDeleteTimerChanged.h @@ -0,0 +1,26 @@ +#ifndef TGBOT_CPP_MESSAGEAUTODELETETIMERCHANGED_H +#define TGBOT_CPP_MESSAGEAUTODELETETIMERCHANGED_H + +#include <cstdint> +#include <memory> + +namespace TgBot { + +/** + * @brief This object represents a service message about a change in auto-delete timer settings. + * + * @ingroup types + */ +class MessageAutoDeleteTimerChanged { + +public: + typedef std::shared_ptr<MessageAutoDeleteTimerChanged> Ptr; + + /** + * @brief New auto-delete time for messages in the chat + */ + std::int32_t messageAutoDeleteTime; +}; +} + +#endif //TGBOT_CPP_MESSAGEAUTODELETETIMERCHANGED_H diff --git a/include/tgbot/types/Update.h b/include/tgbot/types/Update.h index f5b0237..3f15c46 100644 --- a/include/tgbot/types/Update.h +++ b/include/tgbot/types/Update.h @@ -9,6 +9,7 @@ #include "tgbot/types/PreCheckoutQuery.h" #include "tgbot/types/Poll.h" #include "tgbot/types/PollAnswer.h" +#include "tgbot/types/ChatMemberUpdated.h" #include <cstdint> #include <memory> @@ -61,7 +62,7 @@ public: /** * @brief Optional. The result of an inline query that was chosen by a user and sent to their chat partner. - * Please see the documentation on the feedback collecting for details on how to enable these updates for your bot. (https://core.telegram.org/bots/inline#collecting-feedback) + * Please see https://core.telegram.org/bots/inline#collecting-feedback for details on how to enable these updates for your bot. (https://core.telegram.org/bots/inline#collecting-feedback) */ ChosenInlineResult::Ptr chosenInlineResult; @@ -93,6 +94,18 @@ public: * Bots receive new votes only in polls that were sent by the bot itself. */ PollAnswer::Ptr pollAnswer; + + /** + * @brief Optional. The bot's chat member status was updated in a chat. + * For private chats, this update is received only when the bot is blocked or unblocked by the user. + */ + ChatMemberUpdated::Ptr myChatMember; + + /** + * @brief Optional. A chat member's status was updated in a chat. + * The bot must be an administrator in the chat and must explicitly specify βchatMemberβ in the list of allowedUpdates to receive these updates. + */ + ChatMemberUpdated::Ptr chatMember; }; } diff --git a/include/tgbot/types/VoiceChatEnded.h b/include/tgbot/types/VoiceChatEnded.h new file mode 100644 index 0000000..883f6a2 --- /dev/null +++ b/include/tgbot/types/VoiceChatEnded.h @@ -0,0 +1,26 @@ +#ifndef TGBOT_CPP_VOICECHATENDED_H +#define TGBOT_CPP_VOICECHATENDED_H + +#include <cstdint> +#include <memory> + +namespace TgBot { + +/** + * @brief This object represents a service message about a voice chat ended in the chat. + * + * @ingroup types + */ +class VoiceChatEnded { + +public: + typedef std::shared_ptr<VoiceChatEnded> Ptr; + + /** + * @brief This object represents a service message about a voice chat ended in the chat. + */ + std::int32_t duration; +}; +} + +#endif //TGBOT_CPP_VOICECHATENDED_H diff --git a/include/tgbot/types/VoiceChatParticipantsInvited.h b/include/tgbot/types/VoiceChatParticipantsInvited.h new file mode 100644 index 0000000..f96c800 --- /dev/null +++ b/include/tgbot/types/VoiceChatParticipantsInvited.h @@ -0,0 +1,28 @@ +#ifndef TGBOT_CPP_VOICECHATPARTICIPANTSINVITED_H +#define TGBOT_CPP_VOICECHATPARTICIPANTSINVITED_H + +#include "tgbot/types/User.h" + +#include <memory> +#include <vector> + +namespace TgBot { + +/** + * @brief This object represents a service message about new members invited to a voice chat. + * + * @ingroup types + */ +class VoiceChatParticipantsInvited { + +public: + typedef std::shared_ptr<VoiceChatParticipantsInvited> Ptr; + + /** + * @brief Optional. New members that were invited to the voice chat + */ + std::vector<User::Ptr> users; +}; +} + +#endif //TGBOT_CPP_VOICECHATPARTICIPANTSINVITED_H diff --git a/include/tgbot/types/VoiceChatStarted.h b/include/tgbot/types/VoiceChatStarted.h new file mode 100644 index 0000000..3d4b2e6 --- /dev/null +++ b/include/tgbot/types/VoiceChatStarted.h @@ -0,0 +1,21 @@ +#ifndef TGBOT_CPP_VOICECHATSTARTED_H +#define TGBOT_CPP_VOICECHATSTARTED_H + +#include <memory> + +namespace TgBot { + +/** + * @brief This object represents a service message about a voice chat started in the chat. + * Currently holds no information. + * + * @ingroup types + */ +class VoiceChatStarted { + +public: + typedef std::shared_ptr<VoiceChatStarted> Ptr; +}; +} + +#endif //TGBOT_CPP_VOICECHATSTARTED_H |