diff options
author | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-08-29 18:46:44 +0200 |
---|---|---|
committer | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-08-29 18:46:44 +0200 |
commit | b729f89033dca0cd2b9606060e735abfaf41c1f4 (patch) | |
tree | bfd8783fd4a7f800377e844a4eca4c01be5c9dd8 /src/Api.cpp | |
parent | 336a7c5c4243128afd54133b5e0dfeb9661fb7c2 (diff) |
Update to API 4.5
Diffstat (limited to 'src/Api.cpp')
-rw-r--r-- | src/Api.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
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<HttpReqArg> 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<HttpReqArg> args; @@ -1032,6 +1032,15 @@ bool Api::promoteChatMember(std::int64_t chatId, std::int64_t userId, bool canCh return sendRequest("promoteChatMember", args).get<bool>("", false); } +bool Api::setChatAdministratorCustomTitle(std::int64_t chatId, std::int64_t userId, const std::string& customTitle) const { + vector<HttpReqArg> 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<bool>("", false); +} + bool Api::setChatPermissions(std::int64_t chatId, ChatPermissions::Ptr permissions) const{ vector<HttpReqArg> args; args.reserve(2); |