tdlight/td/telegram/BotCommandScope.h

44 lines
1.1 KiB
C
Raw Normal View History

2021-06-19 03:00:23 +02:00
//
2024-01-01 01:07:21 +01:00
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
2021-06-19 03:00:23 +02:00
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/DialogId.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
2021-06-19 03:00:23 +02:00
#include "td/telegram/UserId.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
namespace td {
class Td;
class BotCommandScope {
enum class Type : int32 {
Default,
AllUsers,
AllChats,
AllChatAdministrators,
Dialog,
DialogAdministrators,
DialogParticipant
};
Type type_ = Type::Default;
DialogId dialog_id_;
UserId user_id_;
explicit BotCommandScope(Type type, DialogId dialog_id = DialogId(), UserId user_id = UserId());
public:
static Result<BotCommandScope> get_bot_command_scope(Td *td, td_api::object_ptr<td_api::BotCommandScope> scope_ptr);
telegram_api::object_ptr<telegram_api::BotCommandScope> get_input_bot_command_scope(const Td *td) const;
};
} // namespace td