From b729f89033dca0cd2b9606060e735abfaf41c1f4 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:46:44 +0200 Subject: Update to API 4.5 --- src/Api.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/Api.cpp') diff --git a/src/Api.cpp b/src/Api.cpp index ff39805..b1a2f69 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -45,7 +45,7 @@ Message::Ptr Api::sendMessage(std::int64_t chatId, const string& text, bool disa } return _tgTypeParser.parseJsonAndGetMessage(sendRequest("sendMessage", args)); } - + Message::Ptr Api::sendMessage(const std::string &chatId, const string& text, bool disableWebPagePreview, std::int32_t replyToMessageId, const GenericReply::Ptr replyMarkup, const string& parseMode, bool disableNotification) const { vector args; args.reserve(7); @@ -67,7 +67,7 @@ Message::Ptr Api::sendMessage(const std::string &chatId, const string& text, boo args.emplace_back("parse_mode", parseMode); } return _tgTypeParser.parseJsonAndGetMessage(sendRequest("sendMessage", args)); -} +} Message::Ptr Api::forwardMessage(std::int64_t chatId, std::int64_t fromChatId, std::int32_t messageId, bool disableNotification) const { vector args; @@ -1032,6 +1032,15 @@ bool Api::promoteChatMember(std::int64_t chatId, std::int64_t userId, bool canCh return sendRequest("promoteChatMember", args).get("", false); } +bool Api::setChatAdministratorCustomTitle(std::int64_t chatId, std::int64_t userId, const std::string& customTitle) const { + vector args; + args.reserve(3); + args.emplace_back("chat_id", chatId); + args.emplace_back("user_id", userId); + args.emplace_back("custom_title", customTitle); + return sendRequest("setChatAdministratorCustomTitle", args).get("", false); +} + bool Api::setChatPermissions(std::int64_t chatId, ChatPermissions::Ptr permissions) const{ vector args; args.reserve(2); -- cgit v1.2.3