/*!
**|   PonkBot
**|   A chat bot for CyTube
**|
**@author    Xaekai
**@copyright 2017
**@license   MIT
*/

'use strict';

const PonkBot = require('./lib/ponkbot.js');

const argv = require('minimist')(process.argv.slice(2));
const configfile = typeof argv.config == "String" ? argv.config : "./config";

const config = require(configfile);
const bot = new PonkBot(config);

@@ -167,143 +167,554 @@
 );%0A%0A
-const argv = require('minimist')(process.argv.slice(2));%0Aconst configfile = typeof argv.config == %22String%22 ? argv.config : %22./config%22;%0A
+function getConfig(args)%7B%0A    let config = './config.js';%0A    config = typeof args.config == %22string%22 ? args.config : config;%0A%0A    // Check for relative path without leading %22./%22%0A    if( !config.match(/%5E%5C//) && config.match(/%5C//))%7B%0A        config = %60./$%7Bconfig%7D%60;%0A    %7D%0A%0A    try %7B%0A        require.resolve(config);%0A    %7D%0A    catch(err) %7B%0A        console.error('Could not locate configuration file');%0A        process.exit(78);%0A    %7D%0A%0A    return config;%0A%7D%0A%0Aconst argv = require('minimist')(process.argv.slice(2));%0Aconst configfile = getConfig(argv);
 %0Acon

Improve handling of missing config file