module.exports = (bot, msg, reply = false, content, chaz = 'this', userObj = false, sendCode = false, code) => {
  if (sendCode) {
    if (userObj) {
      if (code) {
        bot.users.get(chaz).sendCode(code, content)
          .catch(err => bot.funcs.log(err.stack, 'error'))
      } else {
        bot.users.get(chaz).sendCode(null, content)
          .catch(err => bot.funcs.log(err.stack, 'error'))
      }
    } else {
      if (code) {
        if (chaz === 'this') {
          msg.channel.sendCode(code, content)
            .catch(err => bot.funcs.log(err.stack, 'error'))
        } else {
          bot.channels.get(chaz).sendCode(code, content)
            .catch(err => bot.funcs.log(err.stack, 'error'))
        }
      } else {
        if (chaz === 'this') {
          msg.channel.sendCode(null, content)
            .catch(err => bot.funcs.log(err.stack, 'error'))
        } else {
          bot.channels.get(chaz).sendCode(null, content)
            .catch(err => bot.funcs.log(err.stack, 'error'))
        }
      }
    }
  } else {
    if (userObj) {
      bot.users.get(chaz).sendMessage(content)
        .catch(err => bot.funcs.log(err.stack, 'error'))
    } else {
      if (chaz === 'this') {
        if (reply) {
          msg.reply(content)
            .catch(err => bot.funcs.log(err.stack, 'error'))
        } else {
          msg.channel.sendMessage(content)
            .catch(err => bot.funcs.log(err.stack, 'error'))
        }
      } else {
        bot.channels.get(chaz).sendMessage(content)
          .catch(err => bot.funcs.log(err.stack, 'error'))
      }
    }
  }
};
