public function getStatus(int $default_status = -1) : int
    {
        $chat_id = $this->bot->chat_id;
        $redis = $this->bot->getRedis();
        if ($redis->exists($chat_id . ':status')) {
            $this->status = $redis->get($chat_id . ':status');
            return $this->status;
        }

        $redis->set($chat_id . ':status', $default_status);
        $this->status = $default_status;
        return $this->status;
    }
public function getStatus(int $default_status = -1) : int
    {
        $chat_id = $this->bot->chat_id;
        $redis = $this->bot->getRedis();
        if ($redis->exists($chat_id . ':status')) {
            $this->status = $redis->get($chat_id . ':status');
            return $this->status;
        }

        $redis->set($chat_id . ':status', $default_status);
        $this->status = $default_status;
        return $this->status;
    }
public function getStatus ( int $ default_status = - 1 ) : int { $ chat_id = $ this -> bot -> chat_id ; $ redis = $ this -> bot -> getRedis ( ) ; if ( $ redis -> exists ( $ chat_id . ':status' ) ) { $ this -> status = $ redis -> get ( $ chat_id . ':status' ) ; return $ this -> status ; } $ redis -> set ( $ chat_id . ':status' , $ default_status ) ; $ this -> status = $ default_status ; return $ this -> status ; }
\brief Get current user status from Redis and set it in status variable.
\details Throws an exception if the Redis connection is missing.
@param int $default_status <i>Optional</i>. The default status to return
if there is no status for the current user.
@return int The status for the current user, $default_status if missing.
\ brief Get current user status from Redis and set it in status variable . \ details Throws an exception if the Redis connection is missing .