From 4f3a56bf7fcfae055d5f513ff86cf4e1e75e83b7 Mon Sep 17 00:00:00 2001 From: kukin-konstantin Date: Fri, 30 Dec 2016 17:24:35 +0300 Subject: add leaveChat method --- include/tgbot/Api.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/tgbot/Api.h') 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 @@ -325,26 +325,33 @@ 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 getChatAdministrators(int32_t chatId) const; + std::vector 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. -- cgit v1.2.3