src/BotManager.php
protected function setBotExtrasTelegram(): self
    {
        $simple_extras = [
            'admins'         => 'enableAdmins',
            'commands.paths' => 'addCommandsPaths',
            'custom_input'   => 'setCustomInput',
            'paths.download' => 'setDownloadPath',
            'paths.upload'   => 'setUploadPath',
        ];
        // For simple telegram extras, just pass the single param value to the Telegram method.
        foreach ($simple_extras as $param_key => $method) {
            $param = $this->params->getBotParam($param_key);
            if (null !== $param) {
                $this->telegram->$method($param);
            }
        }

        // Database.
        if ($mysql_config = $this->params->getBotParam('mysql', [])) {
            $this->telegram->enableMySql(
                $mysql_config,
                $mysql_config['table_prefix'] ?? null,
                $mysql_config['encoding'] ?? 'utf8mb4'
            );
        }

        // Custom command configs.
        $command_configs = $this->params->getBotParam('commands.configs', []);
        foreach ($command_configs as $command => $config) {
            $this->telegram->setCommandConfig($command, $config);
        }

        // Botan with options.
        if ($botan_token = $this->params->getBotParam('botan.token')) {
            $botan_options = $this->params->getBotParam('botan.options', []);
            $this->telegram->enableBotan($botan_token, $botan_options);
        }

        return $this;
    }
protected function setBotExtrasTelegram(): self
    {
        $simple_extras = [
            'admins'         => 'enableAdmins',
            'commands.paths' => 'addCommandsPaths',
            'custom_input'   => 'setCustomInput',
            'paths.download' => 'setDownloadPath',
            'paths.upload'   => 'setUploadPath',
        ];
        // For simple telegram extras, just pass the single param value to the Telegram method.
        foreach ($simple_extras as $param_key => $method) {
            $param = $this->params->getBotParam($param_key);
            if (null !== $param) {
                $this->telegram->$method($param);
            }
        }

        // Database.
        if ($mysql_config = $this->params->getBotParam('mysql', [])) {
            $this->telegram->enableMySql(
                $mysql_config,
                $mysql_config['table_prefix'] ?? null,
                $mysql_config['encoding'] ?? 'utf8mb4'
            );
        }

        // Custom command configs.
        $command_configs = $this->params->getBotParam('commands.configs', []);
        foreach ($command_configs as $command => $config) {
            $this->telegram->setCommandConfig($command, $config);
        }

        // Botan with options.
        if ($botan_token = $this->params->getBotParam('botan.token')) {
            $botan_options = $this->params->getBotParam('botan.options', []);
            $this->telegram->enableBotan($botan_token, $botan_options);
        }

        return $this;
    }
protected function setBotExtrasTelegram ( ) : self { $ simple_extras = [ 'admins' => 'enableAdmins' , 'commands.paths' => 'addCommandsPaths' , 'custom_input' => 'setCustomInput' , 'paths.download' => 'setDownloadPath' , 'paths.upload' => 'setUploadPath' , ] ; // For simple telegram extras, just pass the single param value to the Telegram method. foreach ( $ simple_extras as $ param_key => $ method ) { $ param = $ this -> params -> getBotParam ( $ param_key ) ; if ( null !== $ param ) { $ this -> telegram -> $ method ( $ param ) ; } } // Database. if ( $ mysql_config = $ this -> params -> getBotParam ( 'mysql' , [ ] ) ) { $ this -> telegram -> enableMySql ( $ mysql_config , $ mysql_config [ 'table_prefix' ] ?? null , $ mysql_config [ 'encoding' ] ?? 'utf8mb4' ) ; } // Custom command configs. $ command_configs = $ this -> params -> getBotParam ( 'commands.configs' , [ ] ) ; foreach ( $ command_configs as $ command => $ config ) { $ this -> telegram -> setCommandConfig ( $ command , $ config ) ; } // Botan with options. if ( $ botan_token = $ this -> params -> getBotParam ( 'botan.token' ) ) { $ botan_options = $ this -> params -> getBotParam ( 'botan.options' , [ ] ) ; $ this -> telegram -> enableBotan ( $ botan_token , $ botan_options ) ; } return $ this ; }
Set extra bot parameters for Telegram object.

@return \TelegramBot\TelegramBotManager\BotManager
@throws \Longman\TelegramBot\Exception\TelegramException
Set extra bot parameters for Telegram object .