1 | <?php |
||
28 | class Bot extends Core\BaseBot |
||
29 | { |
||
30 | use Commands\MessageCommand, |
||
31 | Commands\MessageRegexCommand, |
||
32 | Commands\CallbackCommand, |
||
33 | Database\LongPolling, |
||
34 | Database\Handler, |
||
35 | Database\User, |
||
36 | Localization\File, |
||
37 | Localization\Language, |
||
38 | Localization\LocalizedString, |
||
39 | Utilities\BotState; |
||
40 | |||
41 | /** |
||
42 | * \addtogroup Bot Bot |
||
43 | * \brief Properties and methods to handle your Telegrams bot. |
||
44 | * \details Here're listed all the properties and methods that offers facilities for bot's basic features. |
||
45 | * @{ |
||
46 | */ |
||
47 | |||
48 | /** \brief Store the inline keyboard */ |
||
49 | public $keyboard; |
||
50 | |||
51 | /** \brief Manage connection with database using PDO */ |
||
52 | public $pdo; |
||
53 | |||
54 | /** \brief Manage connection with Redis */ |
||
55 | public $redis; |
||
56 | |||
57 | /** |
||
58 | * \brief Construct an empty bot. |
||
59 | * \details Construct a complete Telegram bot which can use localization, database and more other. |
||
60 | * |
||
61 | * @param string $token Bot token, you can request one through **BotFather** on Telegram. |
||
62 | */ |
||
63 | public function __construct(string $token) |
||
64 | { |
||
65 | parent::__construct($token); |
||
66 | |||
67 | $this->_message_commands = []; |
||
68 | $this->_callback_commands = []; |
||
69 | |||
70 | $this->keyboard = new Button($this); |
||
71 | } |
||
72 | |||
73 | /** \brief Destroy the bot closing connections with database and Redis */ |
||
74 | public function __destruct() |
||
84 | |||
85 | /** @} */ |
||
86 | } |
||
87 |