src/Localization/Language.php 1 location
|
@@ 96-102 (lines=7) @@
|
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
// Check if the language exists on Redis |
| 96 |
|
if ($this->redis->exists($this->_chat_id . ':language')) { |
| 97 |
|
$this->language = $this->redis->get($this->_chat_id . ':language'); |
| 98 |
|
return $this->language; |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
// Set the value from the database |
| 102 |
|
$this->redis->setEx($this->_chat_id . ':language', $expiring_time, |
| 103 |
|
$this->getLanguageDatabase($default_language)); |
| 104 |
|
return $this->language; |
| 105 |
|
} |
src/Utilities/BotState.php 1 location
|
@@ 116-122 (lines=7) @@
|
| 113 |
|
throw new BotException('Redis connection not set'); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
if ($this->redis->exists($this->_chat_id . ':status')) { |
| 117 |
|
$this->status = $this->redis->get($this->_chat_id . ':status'); |
| 118 |
|
|
| 119 |
|
return $this->status; |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
$this->redis->set($this->_chat_id . ':status', $default_status); |
| 123 |
|
$this->status = $default_status; |
| 124 |
|
|
| 125 |
|
return $default_status; |