aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/BotCommand.h
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2021-06-21 02:36:04 +0300
committerlevlam <levlam@telegram.org>2021-06-21 02:36:04 +0300
commit5f9fd502b701f17069ecf64fd797aa73366218cd (patch)
treeea9a5bc45a7718059765df48608dacab0d1c6b12 /td/telegram/BotCommand.h
parentf1654291435597e6633d79e4afdd96c135d83012 (diff)
Replace botInfo with commands in userFullInfo.
Diffstat (limited to 'td/telegram/BotCommand.h')
-rw-r--r--td/telegram/BotCommand.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/td/telegram/BotCommand.h b/td/telegram/BotCommand.h
index fd7a78fbc..a0d48fd82 100644
--- a/td/telegram/BotCommand.h
+++ b/td/telegram/BotCommand.h
@@ -21,8 +21,12 @@ class BotCommand {
string command_;
string description_;
+ friend bool operator==(const BotCommand &lhs, const BotCommand &rhs);
+
public:
BotCommand() = default;
+ BotCommand(string command, string description) : command_(std::move(command)), description_(std::move(description)) {
+ }
BotCommand(telegram_api::object_ptr<telegram_api::botCommand> &&bot_command);
td_api::object_ptr<td_api::botCommand> get_bot_command_object() const;
@@ -40,10 +44,18 @@ class BotCommand {
}
};
+bool operator==(const BotCommand &lhs, const BotCommand &rhs);
+
+inline bool operator!=(const BotCommand &lhs, const BotCommand &rhs) {
+ return !(lhs == rhs);
+}
+
class BotCommands {
UserId bot_user_id_;
vector<BotCommand> commands_;
+ friend bool operator==(const BotCommands &lhs, const BotCommands &rhs);
+
public:
BotCommands() = default;
BotCommands(UserId bot_user_id, vector<telegram_api::object_ptr<telegram_api::botCommand>> &&bot_commands);
@@ -63,4 +75,10 @@ class BotCommands {
}
};
+bool operator==(const BotCommands &lhs, const BotCommands &rhs);
+
+inline bool operator!=(const BotCommands &lhs, const BotCommands &rhs) {
+ return !(lhs == rhs);
+}
+
} // namespace td