public function setLanguageRedis(string $language, int $expiring_time = 86400) : bool
    {
        $redis = $this->bot->getRedis();

        // If we could successfully set the language in the database
        if ($this->setLanguageDatabase($language)) {
            // Set the language in Redis
            $redis->setEx($this->bot->chat_id . ':language', $expiring_time, $language);
            return true;
        }

        return false;
    }
public function setLanguageRedis(string $language, int $expiring_time = 86400) : bool
    {
        $redis = $this->bot->getRedis();

        // If we could successfully set the language in the database
        if ($this->setLanguageDatabase($language)) {
            // Set the language in Redis
            $redis->setEx($this->bot->chat_id . ':language', $expiring_time, $language);
            return true;
        }

        return false;
    }
public function setLanguageRedis ( string $ language , int $ expiring_time = 86400 ) : bool { $ redis = $ this -> bot -> getRedis ( ) ; // If we could successfully set the language in the database if ( $ this -> setLanguageDatabase ( $ language ) ) { // Set the language in Redis $ redis -> setEx ( $ this -> bot -> chat_id . ':language' , $ expiring_time , $ language ) ; return true ; } return false ; }
\brief Set the current user language in both Redis, database and internally.
\details Save it into database first, then create the expiring key on Redis.
@param string $language The language to set.
@param int $expiring_time <i>Optional</i>. Time for the language key in redis to expire.
@return bool On sucess, return true, throws exception otherwise.
\ brief Set the current user language in both Redis database and internally . \ details Save it into database first then create the expiring key on Redis .