title: How do I fix my Discord bot being offline?
body: <p>I got recently interested in discord bots coding and I don't know what the problem is with this error, I tried different solutions I can find but all of them are not working and my bot is still offline on the server. </p>
  
  <pre class="lang-none prettyprint-override"><code>Error: Invalid transport, must be an object with a log method.
    at new LegacyTransportStream (C:\Users\redacted\Desktop\NinyaBot\node_modules\winston-transport\legacy.js:18:11)
    at DerivedLogger.add (C:\Users\redacted\Desktop\NinyaBot\node_modules\winston\lib\winston\logger.js:345:11)
    at Object.winston.&lt;computed&gt; [as add] (C:\Users\redacted\Desktop\NinyaBot\node_modules\winston\lib\winston.js:110:68)
    at Object.&lt;anonymous&gt; (C:\Users\redacted\Desktop\NinyaBot\bot.js:6:8)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
  </code></pre>
  
  <ul>
  <li><p>this is the code i used that i found online. </p>
  
  <pre><code>var Discord = require('discord.io');
  var logger = require('winston');
  var auth = require('./auth.json');
  // Configure logger settings
  logger.remove(logger.transports.Console);
  logger.add(logger.transports.Console, {
      colorize: true
  });
  logger.level = 'debug';
  // Initialize Discord Bot
  var bot = new Discord.Client({
     token: auth.token,
     autorun: true
  });
  bot.on('ready', function (evt) {
      logger.info('Connected');
      logger.info('Logged in as: ');
      logger.info(bot.username + ' - (' + bot.id + ')');
  });
  bot.on('message', function (user, userID, channelID, message, evt) {
      // Our bot needs to know if it will execute a command
      // It will listen for messages that will start with `!`
      if (message.substring(0, 1) == '!') {
          var args = message.substring(1).split(' ');
          var cmd = args[0];
  
          args = args.splice(1);
          switch(cmd) {
             // !ping
              case 'ping':
                  bot.sendMessage({
                      to: channelID,
                      message: 'Pong!'
                  });
              break;
              // Just add any case commands if you want to..
           }
       }
  });
  </code></pre></li>
  </ul>