data_peer_bot_commands.h 736 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "data/data_peer_bot_command.h"
  9. namespace Data {
  10. struct BotCommands final {
  11. UserId userId;
  12. std::vector<BotCommand> commands;
  13. };
  14. struct ChatBotCommands final : public base::flat_map<
  15. UserId,
  16. std::vector<BotCommand>> {
  17. public:
  18. using Changed = bool;
  19. using base::flat_map<UserId, std::vector<BotCommand>>::flat_map;
  20. Changed update(const std::vector<BotCommands> &list);
  21. };
  22. [[nodiscard]] BotCommands BotCommandsFromTL(const MTPBotInfo &result);
  23. } // namespace Data