summaryrefslogtreecommitdiff
path: root/include/tgbot
diff options
context:
space:
mode:
Diffstat (limited to 'include/tgbot')
-rw-r--r--include/tgbot/Api.h11
-rw-r--r--include/tgbot/TgTypeParser.h4
-rw-r--r--include/tgbot/types/Chat.h7
-rw-r--r--include/tgbot/types/InlineKeyboardButton.h10
-rw-r--r--include/tgbot/types/Message.h14
-rw-r--r--include/tgbot/types/PollAnswer.h20
-rw-r--r--include/tgbot/types/Story.h22
7 files changed, 74 insertions, 14 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index 5efe50f..c3df15c 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -1350,6 +1350,17 @@ public:
bool unhideGeneralForumTopic(boost::variant<std::int64_t, std::string> chatId) const;
/**
+ * @brief Use this method to clear the list of pinned messages in a General forum topic.
+ *
+ * The bot must be an administrator in the chat for this to work and must have the canPinMessages administrator right in the supergroup.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+ *
+ * @return Returns True on success.
+ */
+ bool unpinAllGeneralForumTopicMessages(boost::variant<std::int64_t, std::string> chatId) const;
+
+ /**
* @brief Use this method to send answers to callback queries sent from inline keyboards.
*
* The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h
index 99a38a9..ad610df 100644
--- a/include/tgbot/TgTypeParser.h
+++ b/include/tgbot/TgTypeParser.h
@@ -13,6 +13,7 @@
#include "tgbot/types/Animation.h"
#include "tgbot/types/Audio.h"
#include "tgbot/types/Document.h"
+#include "tgbot/types/Story.h"
#include "tgbot/types/Video.h"
#include "tgbot/types/VideoNote.h"
#include "tgbot/types/Voice.h"
@@ -205,6 +206,9 @@ public:
Document::Ptr parseJsonAndGetDocument(const boost::property_tree::ptree& data) const;
std::string parseDocument(const Document::Ptr& object) const;
+ Story::Ptr parseJsonAndGetStory(const boost::property_tree::ptree& data) const;
+ std::string parseStory(const Story::Ptr& object) const;
+
Video::Ptr parseJsonAndGetVideo(const boost::property_tree::ptree& data) const;
std::string parseVideo(const Video::Ptr& object) const;
diff --git a/include/tgbot/types/Chat.h b/include/tgbot/types/Chat.h
index 2401300..e838046 100644
--- a/include/tgbot/types/Chat.h
+++ b/include/tgbot/types/Chat.h
@@ -91,6 +91,13 @@ public:
std::string emojiStatusCustomEmojiId;
/**
+ * @brief Optional. Expiration date of the emoji status of the other party in a private chat, if any.
+ *
+ * Returned only in Api::getChat.
+ */
+ std::int64_t emojiStatusExpirationDate;
+
+ /**
* @brief Optional. Bio of the other party in a private chat.
*
* Returned only in Api::getChat.
diff --git a/include/tgbot/types/InlineKeyboardButton.h b/include/tgbot/types/InlineKeyboardButton.h
index 1f2e16f..3b59ce8 100644
--- a/include/tgbot/types/InlineKeyboardButton.h
+++ b/include/tgbot/types/InlineKeyboardButton.h
@@ -13,6 +13,7 @@ namespace TgBot {
/**
* @brief This object represents one button of an inline keyboard.
+ *
* You must use exactly one of the optional fields.
*
* @ingroup types
@@ -28,6 +29,7 @@ public:
/**
* @brief Optional. HTTP or tg:// URL to be opened when the button is pressed.
+ *
* Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
*/
std::string url;
@@ -39,6 +41,7 @@ public:
/**
* @brief Optional. Description of the Web App that will be launched when the user presses the button.
+ *
* The Web App will be able to send an arbitrary message on behalf of the user using the method Api::answerWebAppQuery.
* Available only in private chats between a user and the bot.
*/
@@ -46,23 +49,22 @@ public:
/**
* @brief Optional. An HTTPS URL used to automatically authorize the user.
+ *
* Can be used as a replacement for the Telegram Login Widget.
*/
LoginUrl::Ptr loginUrl;
/**
* @brief Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field.
+ *
* May be empty, in which case just the bot's username will be inserted.
- *
- * Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it.
- * Especially useful when combined with switch_pm… actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
*/
std::string switchInlineQuery;
/**
* @brief Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field.
- * May be empty, in which case only the bot's username will be inserted.
*
+ * May be empty, in which case only the bot's username will be inserted.
* This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.
*/
std::string switchInlineQueryCurrentChat;
diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h
index 8ed8300..a38dd01 100644
--- a/include/tgbot/types/Message.h
+++ b/include/tgbot/types/Message.h
@@ -10,6 +10,7 @@
#include "tgbot/types/Document.h"
#include "tgbot/types/PhotoSize.h"
#include "tgbot/types/Sticker.h"
+#include "tgbot/types/Story.h"
#include "tgbot/types/Video.h"
#include "tgbot/types/VideoNote.h"
#include "tgbot/types/Voice.h"
@@ -41,9 +42,9 @@
#include "tgbot/types/InlineKeyboardMarkup.h"
#include <cstdint>
+#include <memory>
#include <string>
#include <vector>
-#include <memory>
namespace TgBot {
@@ -84,7 +85,7 @@ public:
/**
* @brief Date the message was sent in Unix time
*/
- std::int32_t date;
+ std::int64_t date;
/**
* @brief Conversation the message belongs to
@@ -119,7 +120,7 @@ public:
/**
* @brief Optional. For forwarded messages, date the original message was sent in Unix time
*/
- std::int32_t forwardDate;
+ std::int64_t forwardDate;
/**
* @brief Optional. True, if the message is sent to a forum topic
@@ -146,7 +147,7 @@ public:
/**
* @brief Optional. Date the message was last edited in Unix time
*/
- std::int32_t editDate;
+ std::int64_t editDate;
/**
* @brief Optional. True, if the message can't be forwarded
@@ -201,6 +202,11 @@ public:
Sticker::Ptr sticker;
/**
+ * @brief Optional. Message is a forwarded story
+ */
+ Story::Ptr story;
+
+ /**
* @brief Optional. Message is a video, information about the video
*/
Video::Ptr video;
diff --git a/include/tgbot/types/PollAnswer.h b/include/tgbot/types/PollAnswer.h
index 4476d63..af96377 100644
--- a/include/tgbot/types/PollAnswer.h
+++ b/include/tgbot/types/PollAnswer.h
@@ -1,8 +1,10 @@
-#ifndef TGBOT_CPP_POLLANSWER_H
-#define TGBOT_CPP_POLLANSWER_H
+#ifndef TGBOT_POLLANSWER_H
+#define TGBOT_POLLANSWER_H
+#include "tgbot/types/Chat.h"
#include "tgbot/types/User.h"
+#include <cstdint>
#include <string>
#include <memory>
#include <vector>
@@ -25,16 +27,22 @@ public:
std::string pollId;
/**
- * @brief The user, who changed the answer to the poll
+ * @brief Optional. The chat that changed the answer to the poll, if the voter is anonymous
+ */
+ Chat::Ptr voterChat;
+
+ /**
+ * @brief Optional. The user that changed the answer to the poll, if the voter isn't anonymous
*/
User::Ptr user;
/**
- * @brief 0-based identifiers of answer options, chosen by the user.
- * May be empty if the user retracted their vote.
+ * @brief 0-based identifiers of chosen answer options.
+ *
+ * May be empty if the vote was retracted.
*/
std::vector<std::int32_t> optionIds;
};
}
-#endif //TGBOT_CPP_POLLANSWER_H
+#endif //TGBOT_POLLANSWER_H
diff --git a/include/tgbot/types/Story.h b/include/tgbot/types/Story.h
new file mode 100644
index 0000000..98fd701
--- /dev/null
+++ b/include/tgbot/types/Story.h
@@ -0,0 +1,22 @@
+#ifndef TGBOT_STORY_H
+#define TGBOT_STORY_H
+
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @brief This object represents a message about a forwarded story in the chat.
+ *
+ * Currently holds no information.
+ *
+ * @ingroup types
+ */
+class Story {
+
+public:
+ typedef std::shared_ptr<Story> Ptr;
+};
+}
+
+#endif //TGBOT_STORY_H