diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2023-02-12 00:21:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 00:21:22 +0300 |
commit | c9ebca67ba33cc2e132cc19e51d52ec2d275fac1 (patch) | |
tree | f1a9b410e46f04b69c1b20cd9097ceadb6d9b40e /src/Api.cpp | |
parent | 4356f747596a42dd04766f9c7234fd1aded2eeda (diff) | |
parent | 3734bcc62850389183850846dc46b49fa27c8866 (diff) |
Merge pull request #264 from llnulldisk/master
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); } |