'use strict';

const Discord = require('discord.js');
const client = new Discord.Client();
const winston = require('winston');

require('dotenv').config();

winston.configure({
  transports: [
    new (winston.transports.Console)({
      level: 'debug',
      timestamp: true,
    }),
    new (winston.transports.File)({
      filename: 'sgs_bot.log',
    }),
  ],
});

const channelHandler = require('./event_handlers/channel_handler');
const messageHandler = require('./event_handlers/message_handler');
const presenceHandler = require('./event_handlers/presence_handler');

client.on('ready', () => {
  winston.log('info', 'Logged into Discord as %s', client.user.tag);
  // set creepy presence
  client.user.setPresence({
    status: 'online',
    afk: false,
    game: {
      name: '100% fresh dank memes',
      url: '',
    },
  }).then(() => {
    winston.log('info', 'Presence set.');
  });
  winston.log('info', 'Using %s as prefix for commands',
    process.env.COMMAND_PREFIX);
});

client.on('voiceStateUpdate', channelHandler.handleVoiceStateUpdate);
client.on('message', messageHandler.dispatchMessage);
client.on('presenceUpdate', presenceHandler);

client.login(process.env.DISCORD_KEY);

@@ -679,22 +679,32 @@
 set 
-creepy presenc
+a useful presence messag
 e%0A  
@@ -795,31 +795,54 @@
 me: 
-'100%25 fresh dank memes'
+%60Ask me for $%7Bprocess.env.COMMAND_PREFIX%7Dhelp%60
 ,%0A  

Set a presence message that's useful