diff options
author | kukin-konstantin <kukin.konstantin@gmail.com> | 2016-12-30 17:24:35 +0300 |
---|---|---|
committer | kukin-konstantin <kukin.konstantin@gmail.com> | 2016-12-30 17:24:35 +0300 |
commit | 4f3a56bf7fcfae055d5f513ff86cf4e1e75e83b7 (patch) | |
tree | c0765300c365eecf9f87daddf977368f83f1e945 /include/tgbot/Api.h | |
parent | 9863c73094324724733787807c67f72542970b69 (diff) |
add leaveChat method
Diffstat (limited to 'include/tgbot/Api.h')
-rw-r--r-- | include/tgbot/Api.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index cabcd2a..4cb71a1 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -326,25 +326,32 @@ public: File::Ptr getFile(int32_t fileId) const; /** + * Use this method for your bot to leave a group, supergroup or channel. + * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) + * @return True on success + */ + bool leaveChat(int64_t chatId) const; + + /** * Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success. * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) * @return Chat object. */ - Chat::Ptr getChat(int32_t chatId) const; + Chat::Ptr getChat(int64_t chatId) const; /** * Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) * @return ChatMember object. */ - std::vector<ChatMember::Ptr> getChatAdministrators(int32_t chatId) const; + std::vector<ChatMember::Ptr> getChatAdministrators(int64_t chatId) const; /** * Use this method to get the number of members in a chat. Returns Int on success. * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) * @return Int. */ - int32_t getChatMembersCount(int32_t chatId) const; + int32_t getChatMembersCount(int64_t chatId) const; /** * Use this method to get information about a member of a chat. Returns a ChatMember object on success. @@ -352,7 +359,9 @@ public: * @param userId Unique identifier of the target user * @return ChatMember object. */ - ChatMember::Ptr getChatMember(int32_t chatId, int32_t userId) const; + ChatMember::Ptr getChatMember(int64_t chatId, int32_t userId) const; + + bool answerCallbackQuery(const std::string & callbackQueryId, const std::string & text="", bool showAlert=false, const std::string &url="", int32_t cacheTime=0) const; /** * Use this method to receive incoming updates using long polling. |