/**
 * @file directMessageHandler
 * @author Sankarsan Kampa (a.k.a k3rn31p4nic)
 * @license GPL-3.0
 */

/**
 * Handles direct messages sent to Bastion
 * @param {methods} any methods globally available
 * @param {Message} message Discord.js message object
 * @returns {void}
 */
module.exports = (methods, message) => {
  if (!message.content) return;

  if (message.content.toLowerCase().startsWith('help')) {
    return message.channel.send({
      embed: {
        color: message.client.colors.BLUE,
        title: 'The Bastion Bot',
        url: 'https://bastionbot.org',
        description: 'Join [**Bastion HQ**](https://discord.gg/fzx8fkt) to test Bastion and it\'s commands, for giveaway events, for chatting and for a lot of fun!',
        fields: [
          {
            name: 'Bastion HQ Invite Link',
            value: 'https://discord.gg/fzx8fkt'
          },
          {
            name: 'Bastion Bot Invite Link',
            value: `https://discordapp.com/oauth2/authorize?client_id=${message.client.user.id}&scope=bot&permissions=2146958463`
          }
        ],
        thumbnail: {
          url: message.client.user.displayAvatarURL
        },
        footer: {
          text: '</> with ❤ by Sankarsan Kampa (a.k.a. k3rn31p4nic)'
        }
      }
    }).catch(e => {
      message.client.log.error(e);
    });
  }
  else if (message.content.toLowerCase().startsWith('showspoiler') || message.content.toLowerCase().startsWith('#!showspoiler')) {
    const firstLetterOfMessage = message.content.indexOf('3') + 1;
    const text = message.content.substring(firstLetterOfMessage);
    return message.channel.send({
      embed: {
        color: message.client.colors.BLUE,
        title: 'Here is your decrypted text',
        description: methods.rotThirteen(text.trimLeft())
      }
    }).catch(e => {
      message.client.log.error(e);
    });
  }
  else if (message.content.toLowerCase().startsWith('sendspoiler') || message.content.toLowerCase().startsWith('#!showSpoiler')) {
    const indexOfFirstSpace = message.content.indexOf(' ');
    const indexOfSecondSpace = message.content.indexOf(' ', indexOfFirstSpace + 1);
    const channelId = message.content.substring(indexOfFirstSpace, indexOfSecondSpace).trim();
    const text = message.content.substring(indexOfSecondSpace).trimLeft();
    message.client.channels.get(channelId).send({
      embed: {
        color: message.client.colors.BLUE,
        title: `This message from ${message.author.username} contains spoilers, so we encrypted id`,
        description: 'To decrypt the message, send me a dm with the #!showSpoiler command and the text to decrypt.',
        fields: [
          {
            name: 'Here is the encrypted text',
            value: methods.rotThirteen(text.trimLeft())
          }
        ]
      }
    }).catch(e => {
      message.client.log.error(e);
      return message.channel.send({
        embed: {
          color: message.client.colors.BLUE,
          title: 'There was an error with your input',
          description: 'The correct syntax is #!showSpoiler channelId text'
        }
      });
    });
  }
};

@@ -150,59 +150,8 @@
 ion%0A
- * @param %7Bmethods%7D any methods globally available%0A
  * @
@@ -243,26 +243,16 @@
 ts =
- (methods,
  message
 ) =%3E
@@ -247,17 +247,16 @@
  message
-)
  =%3E %7B%0A  
@@ -1280,1793 +1280,7 @@
   %7D%0A
-  else if (message.content.toLowerCase().startsWith('showspoiler') %7C%7C message.content.toLowerCase().startsWith('#!showspoiler')) %7B%0A    const firstLetterOfMessage = message.content.indexOf('3') + 1;%0A    const text = message.content.substring(firstLetterOfMessage);%0A    return message.channel.send(%7B%0A      embed: %7B%0A        color: message.client.colors.BLUE,%0A        title: 'Here is your decrypted text',%0A        description: methods.rotThirteen(text.trimLeft())%0A      %7D%0A    %7D).catch(e =%3E %7B%0A      message.client.log.error(e);%0A    %7D);%0A  %7D%0A  else if (message.content.toLowerCase().startsWith('sendspoiler') %7C%7C message.content.toLowerCase().startsWith('#!showSpoiler')) %7B%0A    const indexOfFirstSpace = message.content.indexOf(' ');%0A    const indexOfSecondSpace = message.content.indexOf(' ', indexOfFirstSpace + 1);%0A    const channelId = message.content.substring(indexOfFirstSpace, indexOfSecondSpace).trim();%0A    const text = message.content.substring(indexOfSecondSpace).trimLeft();%0A    message.client.channels.get(channelId).send(%7B%0A      embed: %7B%0A        color: message.client.colors.BLUE,%0A        title: %60This message from $%7Bmessage.author.username%7D contains spoilers, so we encrypted id%60,%0A        description: 'To decrypt the message, send me a dm with the #!showSpoiler command and the text to decrypt.',%0A        fields: %5B%0A          %7B%0A            name: 'Here is the encrypted text',%0A            value: methods.rotThirteen(text.trimLeft())%0A          %7D%0A        %5D%0A      %7D%0A    %7D).catch(e =%3E %7B%0A      message.client.log.error(e);%0A      return message.channel.send(%7B%0A        embed: %7B%0A          color: message.client.colors.BLUE,%0A          title: 'There was an error with your input',%0A          description: 'The correct syntax is #!showSpoiler channelId text'%0A        %7D%0A      %7D);%0A    %7D);%0A  %7D%0A
 %7D;%0A

revert to the way it was before the pr