text: const { oneLine, } = require('common-tags');
  const Commando = require('discord.js-commando');
  const live = require('./liveManager');
  
  require('dotenv').config();
  
  const client = new Commando.Client({
    owner: process.env.BOT_DISCORD_OWNER_ID,
    commandPrefix: process.env.BOT_COMMAND_PREFIX,
  });
  
  client
    .on('error', console.error)
    .on('warn', console.warn)
    .on('debug', console.log)
    .on('ready', () => {
      console.log(
        `Client ready; logged in as ${client.user.username}#${
          client.user.discriminator
        } (${client.user.id})`
      );
  
      live.initLiveManager(client);
    })
    .on('disconnect', () => {
      console.warn('Disconnected!');
    })
    .on('reconnecting', () => {
      console.warn('Reconnecting...');
    })
    .on('commandError', (cmd, err) => {
      if (err instanceof Commando.FriendlyError) return;
      console.error(`Error in command ${cmd.groupID}:${cmd.memberName}`, err);
    })
    .on('commandBlocked', (msg, reason) => {
      console.log(oneLine`
        Command ${
    msg.command ? `${msg.command.groupID}:${msg.command.memberName}` : ''
  }
        blocked; ${reason}
        `);
    })
    .on('commandPrefixChange', (guild, prefix) => {
      console.log(oneLine`
        Prefix ${
    prefix === '' ? 'removed' : `changed to ${prefix || 'the default'}`
  }
        ${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}.
      `);
    })
    .on('commandStatusChange', (guild, command, enabled) => {
      console.log(oneLine`
        Command ${command.groupID}:${command.memberName}
        ${enabled ? 'enabled' : 'disabled'}
        ${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}.
      `);
    })
    .on('groupStatusChange', (guild, group, enabled) => {
      console.log(oneLine`
        Group ${group.id}
        ${enabled ? 'enabled' : 'disabled'}
        ${guild ? `in guild ${guild.name} (${guild.id})` : 'globally'}.
      `);
    });
  
  client.registry.registerDefaults();
  
  client.login(process.env.BOT_TOKEN);
  