diff options
author | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2023-02-11 18:12:59 +0100 |
---|---|---|
committer | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2023-02-11 18:12:59 +0100 |
commit | 0caef51105de2c56d0797d87864db53129d778e6 (patch) | |
tree | ddafa5a9616b8bcec94fe9879f4b2a2abeb82efb /src/Api.cpp | |
parent | 4356f747596a42dd04766f9c7234fd1aded2eeda (diff) |
Update to Bot API 6.5
Diffstat (limited to 'src/Api.cpp')
-rw-r--r-- | src/Api.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Api.cpp b/src/Api.cpp index 54854f8..43a9dba 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -1141,13 +1141,17 @@ bool Api::unbanChatMember(boost::variant<std::int64_t, std::string> chatId, bool Api::restrictChatMember(boost::variant<std::int64_t, std::string> chatId, std::int64_t userId, TgBot::ChatPermissions::Ptr permissions, - std::int64_t untilDate) const { + std::int64_t untilDate, + bool useIndependentChatPermissions) const { std::vector<HttpReqArg> args; - args.reserve(4); + args.reserve(5); args.emplace_back("chat_id", chatId); args.emplace_back("user_id", userId); args.emplace_back("permissions", _tgTypeParser.parseChatPermissions(permissions)); + if (useIndependentChatPermissions) { + args.emplace_back("use_independent_chat_permissions", useIndependentChatPermissions); + } if (untilDate) { args.emplace_back("until_date", untilDate); } @@ -1250,12 +1254,16 @@ bool Api::unbanChatSenderChat(boost::variant<std::int64_t, std::string> chatId, } bool Api::setChatPermissions(boost::variant<std::int64_t, std::string> chatId, - ChatPermissions::Ptr permissions) const { + ChatPermissions::Ptr permissions, + bool useIndependentChatPermissions) const { std::vector<HttpReqArg> args; - args.reserve(2); + args.reserve(3); args.emplace_back("chat_id", chatId); args.emplace_back("permissions", _tgTypeParser.parseChatPermissions(permissions)); + if (useIndependentChatPermissions) { + args.emplace_back("use_independent_chat_permissions", useIndependentChatPermissions); + } return sendRequest("setChatPermissions", args).get<bool>("", false); } |