public function connectUserByCode($code, $chat_id) { $user_id = $this->verify->checkCode($code); if ($user_id) { $data = $this->readDataFile(); $data[$user_id] = $chat_id; $this->writeDataFile($data); return $this->telegram->sendWebhookMessage('Вы успешно подключили функцию уведомления', $chat_id); } else { return $this->telegram->sendWebhookMessage('Неверный код', $chat_id); } }