var DISCORD = (function(){
  var templateChannelServer;
  var templateChannelPrivate;
  var templateMessage;
  
  return {
    setup: function(){
      templateChannelServer = new TEMPLATE([
        "<div data-channel='{id}'>",
        "<div class='info'><strong class='name'>#{name}</strong><span class='msgcount'>{msgcount}</span></div>",
        "<span class='server'>{server.name} ({server.type})</span>",
        "</div>"
      ].join(""));
      
      templateChannelPrivate = new TEMPLATE([
        "<div data-channel='{id}'>",
        "<div class='info'><strong class='name'>{name}</strong><span class='msgcount'>{msgcount}</span></div>",
        "<span class='server'>({server.type})</span>",
        "</div>"
      ].join(""));
      
      templateMessage = new TEMPLATE([
        "<div>",
        "<h2><strong class='username'>{user.name}</strong><span class='time'>{timestamp}</span></h2>",
        "<div class='message'>{contents}</div>",
        "</div>"
      ].join(""));
    },
    
    getChannelHTML: function(channel){
      return (channel.server.type === "SERVER" ? templateChannelServer : templateChannelPrivate).apply(channel, (property, value) => {
        if (property === "server.type"){
          switch(value){
            case "SERVER": return "server";
            case "GROUP": return "group";
            case "DM": return "user";
          }
        }
      });
    },
    
    getMessageHTML: function(message){
      return templateMessage.apply(message, (property, value) => {
        if (property === "timestamp"){
          var date = new Date(value);
          return date.toLocaleDateString()+", "+date.toLocaleTimeString();
        }
      });
    }
  };
})();

@@ -20,16 +20,438 @@
 tion()%7B%0A
+  var REGEX = %7B%0A    formatBold: /%5C*%5C*(%5B%5Cs%5CS%5D+?)%5C*%5C*(?!%5C*)/g,%0A    formatItalic: /%5C/%5C/(%5B%5Cs%5CS%5D+?)%5C/%5C/(?!%5C/)/g,%0A    formatUnderline: /__(%5B%5Cs%5CS%5D+?)__(?!_)/g,%0A    formatStrike: /~~(%5B%5Cs%5CS%5D+?)~~(?!~)/g,%0A    formatCodeInline: /(%60+)%5Cs*(%5B%5Cs%5CS%5D*?%5B%5E%60%5D)%5Cs*%5C1(?!%60)/g,%0A    formatCodeBlock: /%60%60%60((%5BA-z0-9%5C-%5D+?)%5Cn+)?%5Cn*(%5B%5E%5D+?)%5Cn*%60%60%60/g,%0A    metionRole: /%3C@&(%5Cd+?)%3E/g,%0A    metionUser: /%3C@!?(%5Cd+?)%3E/g,%0A    mentionChannel: /%3C#(%5Cd+?)%3E/g%0A  %7D;%0A  %0A
   var te

Add regular expressions for formatting to scr.discord.js