From 0caef51105de2c56d0797d87864db53129d778e6 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Sat, 11 Feb 2023 18:12:59 +0100 Subject: Update to Bot API 6.5 --- src/Api.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/Api.cpp') 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 chatId, bool Api::restrictChatMember(boost::variant chatId, std::int64_t userId, TgBot::ChatPermissions::Ptr permissions, - std::int64_t untilDate) const { + std::int64_t untilDate, + bool useIndependentChatPermissions) const { std::vector 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 chatId, } bool Api::setChatPermissions(boost::variant chatId, - ChatPermissions::Ptr permissions) const { + ChatPermissions::Ptr permissions, + bool useIndependentChatPermissions) const { std::vector 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("", false); } -- cgit v1.2.3