summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkukin-konstantin <kukin.konstantin@gmail.com>2016-12-30 16:23:18 +0300
committerkukin-konstantin <kukin.konstantin@gmail.com>2016-12-30 16:23:18 +0300
commit9863c73094324724733787807c67f72542970b69 (patch)
tree238195e7fe0e1e0a2e6b14277bc64593da7722b2 /src
parent156bac1c6b2d8ce28f1a13b11bca3e8da285aa3d (diff)
Add getFile, edit kickChatMember, urbanChatMember
Diffstat (limited to 'src')
-rw-r--r--src/Api.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Api.cpp b/src/Api.cpp
index 4b08f98..673f368 100644
--- a/src/Api.cpp
+++ b/src/Api.cpp
@@ -410,6 +410,13 @@ UserProfilePhotos::Ptr Api::getUserProfilePhotos(int32_t userId, int32_t offset,
return TgTypeParser::getInstance().parseJsonAndGetUserProfilePhotos(sendRequest("getUserProfilePhotos", args));
}
+File::Ptr Api::getFile(int32_t fileId) const
+{
+ vector<HttpReqArg> args;
+ args.push_back(HttpReqArg("file_id", fileId));
+ return TgTypeParser::getInstance().parseJsonAndGetFile(sendRequest("getFile", args));
+}
+
Chat::Ptr Api::getChat(int32_t chatId) const
{
vector<HttpReqArg> args;
@@ -515,18 +522,18 @@ void Api::answerInlineQuery(const std::string& inlineQueryId, const std::vector<
sendRequest("answerInlineQuery", args);
}
-void Api::kickChatMember(int64_t chatId, int32_t userId) const {
+bool Api::kickChatMember(int64_t chatId, int32_t userId) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("user_id", userId));
- sendRequest("kickChatMember", args);
+ return sendRequest("kickChatMember", args).get<bool>("", false);
}
-void Api::unbanChatMember(int64_t chatId, int32_t userId) const {
+bool Api::unbanChatMember(int64_t chatId, int32_t userId) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("user_id", userId));
- sendRequest("unbanChatMember", args);
+ return sendRequest("unbanChatMember", args).get<bool>("", false);
}
ptree Api::sendRequest(const string& method, const vector<HttpReqArg>& args) const {