Longman\TelegramBot\Telegram::isDbEnabled PHP Method

isDbEnabled() public method

Check if user required the db connection
public isDbEnabled ( ) : boolean
return boolean
    public function isDbEnabled()
    {
        if ($this->mysql_enabled) {
            return true;
        } else {
            return false;
        }
    }

Usage Example

 /**
  * Pre-execute command
  *
  * @return \Longman\TelegramBot\Entities\ServerResponse
  * @throws \Longman\TelegramBot\Exception\TelegramException
  */
 public function preExecute()
 {
     if ($this->need_mysql && !($this->telegram->isDbEnabled() && DB::isDbConnected())) {
         return $this->executeNoDb();
     }
     return $this->execute();
 }