renesansz / discord-greeter-bot

My greeter bot for Discord
MIT License
49 stars 38 forks source link

Error: Invalid transport, must be an object with a log method. #177

Closed mchuong1 closed 6 years ago

mchuong1 commented 6 years ago

I think there is winston version 3 but i have no idea how to transform the code so that its suitable.`` 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..
     }
 }

});