summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Kukin <kukin.konstantin@gmail.com>2016-12-26 16:45:35 +0300
committerKonstantin Kukin <kukin.konstantin@gmail.com>2016-12-26 16:45:35 +0300
commit76d3a4c33a8808552b55b1bf36934b455528a150 (patch)
treef0360532b6757a8662622aec5e3405bf66007191 /include
parent454b2017b87f1796afbafcde19796ab934a89146 (diff)
upgrade existing type and create new
Diffstat (limited to 'include')
-rw-r--r--include/tgbot/types/Audio.h12
-rw-r--r--include/tgbot/types/CallbackQuery.h9
-rw-r--r--include/tgbot/types/Chat.h6
-rw-r--r--include/tgbot/types/ChatMember.h35
-rw-r--r--include/tgbot/types/File.h45
-rw-r--r--include/tgbot/types/InlineKeyboardButton.h5
-rw-r--r--include/tgbot/types/InlineQuery.h6
-rw-r--r--include/tgbot/types/KeyboardButton.h44
-rw-r--r--include/tgbot/types/MessageEntity.h6
-rw-r--r--include/tgbot/types/ReplyKeyboardRemove.h40
-rw-r--r--include/tgbot/types/ResponseParameters.h35
-rw-r--r--include/tgbot/types/Sticker.h5
-rw-r--r--include/tgbot/types/WebhookInfo.h59
13 files changed, 307 insertions, 0 deletions
diff --git a/include/tgbot/types/Audio.h b/include/tgbot/types/Audio.h
index e39eb00..14cf17f 100644
--- a/include/tgbot/types/Audio.h
+++ b/include/tgbot/types/Audio.h
@@ -48,6 +48,18 @@ public:
int32_t duration;
/**
+ * Optional. Performer of the audio as defined by sender
+ * or by audio tags
+ */
+ std::string performer;
+
+ /**
+ * Optional. Title of the audio as defined by sender or
+ * by audio tags
+ */
+ std::string title;
+
+ /**
* Optional. MIME type of the file as defined by sender.
*/
std::string mimeType;
diff --git a/include/tgbot/types/CallbackQuery.h b/include/tgbot/types/CallbackQuery.h
index 5f6871d..8d684c0 100644
--- a/include/tgbot/types/CallbackQuery.h
+++ b/include/tgbot/types/CallbackQuery.h
@@ -42,10 +42,19 @@ public:
std::string inlineMessageId;
/**
+ * Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
+ */
+ std::string chatInstance;
+
+ /**
* Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
*/
std::string data;
+ /*
+ * Optional. Short name of a Game to be returned, serves as the unique identifier for the game
+ */
+ std::string gameShortName;
};
}
diff --git a/include/tgbot/types/Chat.h b/include/tgbot/types/Chat.h
index 9a109e7..1491fd3 100644
--- a/include/tgbot/types/Chat.h
+++ b/include/tgbot/types/Chat.h
@@ -76,6 +76,12 @@ public:
* other party in private chat
*/
std::string lastName;
+
+ /**
+ * Optional. True if a group
+ * has ‘All Members Are Admins’ enabled.
+ */
+ bool allMembersAreAdministrators;
};
}
diff --git a/include/tgbot/types/ChatMember.h b/include/tgbot/types/ChatMember.h
new file mode 100644
index 0000000..7f4b139
--- /dev/null
+++ b/include/tgbot/types/ChatMember.h
@@ -0,0 +1,35 @@
+//
+// Created by Konstantin Kukin on 26/12/16.
+//
+
+#ifndef TGBOT_CHATMEMBER_H
+#define TGBOT_CHATMEMBER_H
+
+#include <memory>
+#include <string>
+
+#include "tgbot/types/User.h"
+
+namespace TgBot {
+
+/**
+ * This object contains information about one member of the chat.
+ * @ingroup types
+ */
+class ChatMember {
+public:
+ typedef std::shared_ptr<ChatMember> Ptr;
+
+ /**
+ * Information about the user
+ */
+ User::Ptr user;
+
+ /**
+ * The member's status in the chat. Can be “creator”, “administrator”, “member”, “left” or “kicked”
+ */
+ std::string status;
+};
+}
+
+#endif //TGBOT_CHATMEMBER_H
diff --git a/include/tgbot/types/File.h b/include/tgbot/types/File.h
new file mode 100644
index 0000000..a370dd6
--- /dev/null
+++ b/include/tgbot/types/File.h
@@ -0,0 +1,45 @@
+//
+// Created by Konstantin Kukin on 26/12/16.
+//
+
+#ifndef TGBOT_CPP_FILE_H
+#define TGBOT_CPP_FILE_H
+
+#include <string>
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * This object represents a file ready to be downloaded.
+ * The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.
+ * It is guaranteed that the link will be valid for at least 1 hour.
+ * When the link expires, a new one can be requested by calling getFile.
+ * Maximum file size to download is 20 MB
+ * @ingroup types
+ */
+class File {
+
+public:
+ typedef std::shared_ptr<File> Ptr;
+
+ /**
+ * Unique identifier for this file
+ */
+ std::string fileId;
+
+ /**
+ * Optional. File size, if known
+ */
+ int32_t fileSize;
+
+ /**
+ * Optional. File path.
+ * Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
+ */
+ std::string filePath;
+};
+
+}
+
+#endif //TGBOT_CPP_FILE_H
diff --git a/include/tgbot/types/InlineKeyboardButton.h b/include/tgbot/types/InlineKeyboardButton.h
index 1a71341..a8fb3db 100644
--- a/include/tgbot/types/InlineKeyboardButton.h
+++ b/include/tgbot/types/InlineKeyboardButton.h
@@ -37,6 +37,11 @@ public:
* 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. Can be empty, in which case just the bot’s username will be inserted.
*/
std::string switchInlineQuery;
+
+ /**
+ * Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
+ */
+ std::string switchInlineQueryCurrentChat;
};
}
diff --git a/include/tgbot/types/InlineQuery.h b/include/tgbot/types/InlineQuery.h
index a469ea7..f2c22c3 100644
--- a/include/tgbot/types/InlineQuery.h
+++ b/include/tgbot/types/InlineQuery.h
@@ -9,6 +9,7 @@
#include <string>
#include "tgbot/types/User.h"
+#include "tgbot/types/Location.h"
namespace TgBot {
@@ -30,6 +31,11 @@ public:
*/
User::Ptr from;
+ /**
+ * Optional. Sender location, only for bots that request user location
+ */
+ Location::Ptr location;
+
/**
* Text of the query.
*/
diff --git a/include/tgbot/types/KeyboardButton.h b/include/tgbot/types/KeyboardButton.h
new file mode 100644
index 0000000..637aced
--- /dev/null
+++ b/include/tgbot/types/KeyboardButton.h
@@ -0,0 +1,44 @@
+//
+// Created by Konstantin Kukin on 26/12/16.
+//
+
+#ifndef TGBOT_CPP_KEYBOARDBUTTON_H
+#define TGBOT_CPP_KEYBOARDBUTTON_H
+
+#include <string>
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * This object represents one button of the reply keyboard.
+ * For simple text buttons String can be used instead of this
+ * object to specify text of the button. Optional fields are mutually exclusive.
+ * @ingroup types
+ */
+class KeyboardButton {
+
+public:
+ typedef std::shared_ptr<KeyboardButton> Ptr;
+
+ /**
+ * Text of the button. If none of the optional fields are used,
+ * it will be sent to the bot as a message when the button is pressed
+ */
+ std::string text;
+
+ /**
+ * Optional. If True, the user's phone number will be sent as a contact
+ * when the button is pressed. Available in private chats only
+ */
+ bool requestContact;
+
+ /**
+ * Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.
+ */
+ bool requestLocation;
+};
+
+}
+
+#endif //TGBOT_CPP_KEYBOARDBUTTON_H
diff --git a/include/tgbot/types/MessageEntity.h b/include/tgbot/types/MessageEntity.h
index 37301e6..ad445cf 100644
--- a/include/tgbot/types/MessageEntity.h
+++ b/include/tgbot/types/MessageEntity.h
@@ -7,6 +7,7 @@
#include <memory>
#include <string>
+#include "tgbot/types/User.h"
namespace TgBot {
@@ -37,6 +38,11 @@ public:
* Optional. For “text_link” only, url that will be opened after user taps on the text
*/
std::string url;
+
+ /**
+ * Optional. For “text_mention” only, the mentioned user
+ */
+ User::Ptr user;
};
}
diff --git a/include/tgbot/types/ReplyKeyboardRemove.h b/include/tgbot/types/ReplyKeyboardRemove.h
new file mode 100644
index 0000000..c47fb7d
--- /dev/null
+++ b/include/tgbot/types/ReplyKeyboardRemove.h
@@ -0,0 +1,40 @@
+//
+// Created by Konstantin Kukin on 26/12/16.
+//
+
+#ifndef TGBOT_CPP_REPLYKEYBOARDREMOVE_H
+#define TGBOT_CPP_REPLYKEYBOARDREMOVE_H
+
+#include <memory>
+
+#include "tgbot/types/GenericReply.h"
+
+namespace TgBot {
+
+/**
+ * Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard.
+ * By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden
+ * immediately after the user presses a button (see ReplyKeyboardMarkup).
+ * @ingroup types
+ */
+class ReplyKeyboardRemove : public GenericReply {
+
+public:
+ typedef std::shared_ptr<ReplyKeyboardRemove> Ptr;
+
+ /**
+ * Requests clients to remove the custom keyboard (user will not be able to summon this keyboard;
+ * if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
+ */
+ const bool removeKeyboard = true;
+
+ /**
+ * Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
+ * Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
+ */
+ bool selective = false;
+};
+
+}
+
+#endif //TGBOT_CPP_REPLYKEYBOARDREMOVE_H
diff --git a/include/tgbot/types/ResponseParameters.h b/include/tgbot/types/ResponseParameters.h
new file mode 100644
index 0000000..0c8bba9
--- /dev/null
+++ b/include/tgbot/types/ResponseParameters.h
@@ -0,0 +1,35 @@
+//
+// Created by Konstantin Kukin on 26/12/16.
+//
+
+#ifndef TGBOT_RESPONSEPARAMETERS_H
+#define TGBOT_RESPONSEPARAMETERS_H
+
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * Contains information about why a request was unsuccessfull.
+ * @ingroup types
+ */
+class ResponseParameters {
+public:
+ typedef std::shared_ptr<ResponseParameters> Ptr;
+
+ /**
+ * Optional. The group has been migrated to a supergroup with the specified identifier.
+ * This number may be greater than 32 bits and some programming languages may have
+ * difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a
+ * signed 64 bit integer or double-precision float type are safe for storing this identifier.
+ */
+ int32_t migrateToChatId;
+
+ /**
+ * Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
+ */
+ int32_t retryAfter;
+};
+}
+
+#endif //TGBOT_RESPONSEPARAMETERS_H
diff --git a/include/tgbot/types/Sticker.h b/include/tgbot/types/Sticker.h
index 252fb41..94140c1 100644
--- a/include/tgbot/types/Sticker.h
+++ b/include/tgbot/types/Sticker.h
@@ -60,6 +60,11 @@ public:
PhotoSize::Ptr thumb;
/**
+ * Optional. Emoji associated with the sticker
+ */
+ std::string emoji;
+
+ /**
* Optional. File size.
*/
int32_t fileSize;
diff --git a/include/tgbot/types/WebhookInfo.h b/include/tgbot/types/WebhookInfo.h
new file mode 100644
index 0000000..f08e4ac
--- /dev/null
+++ b/include/tgbot/types/WebhookInfo.h
@@ -0,0 +1,59 @@
+//
+// Created by Konstantin Kukin on 26/12/16.
+//
+
+#ifndef TGBOT_WEBHOOKINFO_H
+#define TGBOT_WEBHOOKINFO_H
+
+#include <string>
+#include <vector>
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * Contains information about the current status of a webhook.
+ * @ingroup types
+ */
+class WebhookInfo {
+public:
+ typedef std::shared_ptr<WebhookInfo> Ptr;
+
+ /**
+ * Webhook URL, may be empty if webhook is not set up.
+ */
+ std::string url;
+
+ /**
+ * True, if a custom certificate was provided for webhook certificate checks
+ */
+ bool hasCustomCertificate;
+
+ /**
+ * Number of updates awaiting delivery
+ */
+ int32_t pendingUpdateCount;
+
+ /**
+ * Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
+ */
+ int32_t lastErrorDate;
+
+ /**
+ * Optional. Error message in human - readable format for the most recent error that happened when trying to deliver an update via webhook
+ */
+ std::string lastErrorMessage;
+
+ /**
+ * Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
+ */
+ int32_t maxConnections;
+
+ /**
+ * Optional. A list of update types the bot is subscribed to. Defaults to all update types
+ */
+ std::vector<std::string> allowedUpdates;
+};
+}
+
+#endif //TGBOT_WEBHOOKINFO_H