Skip to content

Commit 28de9c6

Browse files
committed
Update to Bot API 7.1
1 parent 5154dab commit 28de9c6

34 files changed

+334
-173
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
99

1010
## State
1111

12-
- [x] Telegram Bot API 7.0
12+
- [x] Telegram Bot API 7.1
1313
- [ ] [MaybeInaccessibleMessage](https://core.telegram.org/bots/api#maybeinaccessiblemessage)
1414
- [ ] [Message->pinnedMessage](https://core.telegram.org/bots/api#message)
1515
- [ ] [CallbackQuery->message](https://core.telegram.org/bots/api#callbackquery)

include/tgbot/Api.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,13 +892,13 @@ friend class Bot;
892892
* @param canPinMessages Optional. Pass True if the administrator can pin messages, supergroups only
893893
* @param canPromoteMembers Optional. Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
894894
* @param isAnonymous Optional. Pass True if the administrator's presence in the chat is hidden
895-
* @param canManageChat Optional. Pass True if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
895+
* @param canManageChat Optional. Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.
896896
* @param canManageVideoChats Optional. Pass True if the administrator can manage video chats
897897
* @param canRestrictMembers Optional. Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics
898898
* @param canManageTopics Optional. Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
899-
* @param canPostStories Optional. Pass True if the administrator can post stories in the channel; channels only
900-
* @param canEditStories Optional. Pass True if the administrator can edit stories posted by other users; channels only
901-
* @param canDeleteStories Optional. Pass True if the administrator can delete stories posted by other users; channels only
899+
* @param canPostStories Optional. Pass True if the administrator can post stories to the chat
900+
* @param canEditStories Optional. Pass True if the administrator can edit stories posted by other users
901+
* @param canDeleteStories Optional. Pass True if the administrator can delete stories posted by other users
902902
*
903903
* @return Returns True on success.
904904
*/

include/tgbot/TgTypeParser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "tgbot/types/WebAppData.h"
3737
#include "tgbot/types/ProximityAlertTriggered.h"
3838
#include "tgbot/types/MessageAutoDeleteTimerChanged.h"
39+
#include "tgbot/types/ChatBoostAdded.h"
3940
#include "tgbot/types/ForumTopicCreated.h"
4041
#include "tgbot/types/ForumTopicClosed.h"
4142
#include "tgbot/types/ForumTopicEdited.h"
@@ -305,6 +306,9 @@ class TGBOT_API TgTypeParser {
305306
MessageAutoDeleteTimerChanged::Ptr parseJsonAndGetMessageAutoDeleteTimerChanged(const boost::property_tree::ptree& data) const;
306307
std::string parseMessageAutoDeleteTimerChanged(const MessageAutoDeleteTimerChanged::Ptr& object) const;
307308

309+
ChatBoostAdded::Ptr parseJsonAndGetChatBoostAdded(const boost::property_tree::ptree& data) const;
310+
std::string parseChatBoostAdded(const ChatBoostAdded::Ptr& object) const;
311+
308312
ForumTopicCreated::Ptr parseJsonAndGetForumTopicCreated(const boost::property_tree::ptree& data) const;
309313
std::string parseForumTopicCreated(const ForumTopicCreated::Ptr& object) const;
310314

include/tgbot/types/Chat.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Chat {
135135
*
136136
* Returned only in Api::getChat.
137137
*/
138-
std::int64_t emojiStatusExpirationDate;
138+
std::uint32_t emojiStatusExpirationDate;
139139

140140
/**
141141
* @brief Optional. Bio of the other party in a private chat.
@@ -201,12 +201,19 @@ class Chat {
201201
ChatPermissions::Ptr permissions;
202202

203203
/**
204-
* @brief Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds.
204+
* @brief Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds.
205205
*
206206
* Returned only in Api::getChat.
207207
*/
208208
std::int32_t slowModeDelay;
209209

210+
/**
211+
* @brief 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.
212+
*
213+
* Returned only in Api::getChat.
214+
*/
215+
std::int32_t unrestrictBoostCount;
216+
210217
/**
211218
* @brief Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds.
212219
*
@@ -257,6 +264,14 @@ class Chat {
257264
*/
258265
bool canSetStickerSet;
259266

267+
/**
268+
* @brief Optional. For supergroups, the name of the group's custom emoji sticker set.
269+
*
270+
* Custom emoji from this set can be used by all users and bots in the group.
271+
* Returned only in Api::getChat.
272+
*/
273+
std::string customEmojiStickerSetName;
274+
260275
/**
261276
* @brief Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats.
262277
*

include/tgbot/types/ChatAdministratorRights.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class ChatAdministratorRights {
2121
bool isAnonymous;
2222

2323
/**
24-
* @brief True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode.
24+
* @brief True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode.
2525
*
26-
* Implied by any other administrator privilege
26+
* Implied by any other administrator privilege.
2727
*/
2828
bool canManageChat;
2929

@@ -58,34 +58,34 @@ class ChatAdministratorRights {
5858
bool canInviteUsers;
5959

6060
/**
61-
* @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only
61+
* @brief True, if the administrator can post stories to the chat
6262
*/
63-
bool canPostMessages;
63+
bool canPostStories;
6464

6565
/**
66-
* @brief Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
66+
* @brief True, if the administrator can edit stories posted by other users
6767
*/
68-
bool canEditMessages;
68+
bool canEditStories;
6969

7070
/**
71-
* @brief Optional. True, if the user is allowed to pin messages; groups and supergroups only
71+
* @brief True, if the administrator can delete stories posted by other users
7272
*/
73-
bool canPinMessages;
73+
bool canDeleteStories;
7474

7575
/**
76-
* @brief Optional. True, if the administrator can post stories in the channel; channels only
76+
* @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only
7777
*/
78-
bool canPostStories;
78+
bool canPostMessages;
7979

8080
/**
81-
* @brief Optional. True, if the administrator can edit stories posted by other users; channels only
81+
* @brief Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
8282
*/
83-
bool canEditStories;
83+
bool canEditMessages;
8484

8585
/**
86-
* @brief Optional. True, if the administrator can delete stories posted by other users; channels only
86+
* @brief Optional. True, if the user is allowed to pin messages; groups and supergroups only
8787
*/
88-
bool canDeleteStories;
88+
bool canPinMessages;
8989

9090
/**
9191
* @brief Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

include/tgbot/types/ChatBoostAdded.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef TGBOT_CHATBOOSTADDED_H
2+
#define TGBOT_CHATBOOSTADDED_H
3+
4+
#include <cstdint>
5+
#include <memory>
6+
7+
namespace TgBot {
8+
9+
/**
10+
* @brief This object represents a service message about a user boosting a chat.
11+
*
12+
* @ingroup types
13+
*/
14+
class ChatBoostAdded {
15+
16+
public:
17+
typedef std::shared_ptr<ChatBoostAdded> Ptr;
18+
19+
/**
20+
* @brief Number of boosts added by the user
21+
*/
22+
std::int32_t boostCount;
23+
};
24+
}
25+
26+
#endif //TGBOT_CHATBOOSTADDED_H

include/tgbot/types/ChatBoostUpdated.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ChatBoostUpdated {
2424
Chat::Ptr chat;
2525

2626
/**
27-
* @brief Infomation about the chat boost
27+
* @brief Information about the chat boost
2828
*/
2929
ChatBoost::Ptr boost;
3030
};

include/tgbot/types/ChatMemberAdministrator.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class ChatMemberAdministrator : public ChatMember {
3535
bool isAnonymous;
3636

3737
/**
38-
* @brief True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode.
38+
* @brief True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode.
3939
*
40-
* Implied by any other administrator privilege
40+
* Implied by any other administrator privilege.
4141
*/
4242
bool canManageChat;
4343

@@ -72,34 +72,34 @@ class ChatMemberAdministrator : public ChatMember {
7272
bool canInviteUsers;
7373

7474
/**
75-
* @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only
75+
* @brief True, if the administrator can post stories to the chat
7676
*/
77-
bool canPostMessages;
77+
bool canPostStories;
7878

7979
/**
80-
* @brief Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
80+
* @brief True, if the administrator can edit stories posted by other users
8181
*/
82-
bool canEditMessages;
82+
bool canEditStories;
8383

8484
/**
85-
* @brief Optional. True, if the user is allowed to pin messages; groups and supergroups only
85+
* @brief True, if the administrator can delete stories posted by other users
8686
*/
87-
bool canPinMessages;
87+
bool canDeleteStories;
8888

8989
/**
90-
* @brief Optional. True, if the administrator can post stories in the channel; channels only
90+
* @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only
9191
*/
92-
bool canPostStories;
92+
bool canPostMessages;
9393

9494
/**
95-
* @brief Optional. True, if the administrator can edit stories posted by other users; channels only
95+
* @brief Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
9696
*/
97-
bool canEditStories;
97+
bool canEditMessages;
9898

9999
/**
100-
* @brief Optional. True, if the administrator can delete stories posted by other users; channels only
100+
* @brief Optional. True, if the user is allowed to pin messages; groups and supergroups only
101101
*/
102-
bool canDeleteStories;
102+
bool canPinMessages;
103103

104104
/**
105105
* @brief Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

include/tgbot/types/ChatMemberUpdated.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef TGBOT_CPP_CHATMEMBERUPDATED_H
2-
#define TGBOT_CPP_CHATMEMBERUPDATED_H
1+
#ifndef TGBOT_CHATMEMBERUPDATED_H
2+
#define TGBOT_CHATMEMBERUPDATED_H
33

44
#include "tgbot/types/Chat.h"
55
#include "tgbot/types/User.h"
@@ -58,4 +58,4 @@ class ChatMemberUpdated {
5858
};
5959
}
6060

61-
#endif //TGBOT_CPP_CHATMEMBERUPDATED_H
61+
#endif //TGBOT_CHATMEMBERUPDATED_H

include/tgbot/types/ForceReply.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ForceReply : public GenericReply {
4040
/**
4141
* @brief Optional. Use this parameter if you want to force reply from specific users only.
4242
*
43-
* Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has replyToMessageId), sender of the original message.
43+
* Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
4444
*/
4545
bool selective;
4646
};

0 commit comments

Comments
 (0)