const Clapp = require('../modules/clapp-discord');
const cfg = require('../../config.js');
const pkg = require('../../package.json');
const changelogs = require('../../data/changelog');

module.exports = new Clapp.Command({
  name: "changelog",
  desc: "See new features and changes since my last update",
  fn: (argv, context) => {
    let changelog = changelogs[0];

    let message = 'Here\'s what changed with me since my last update (' + changelog.version + '):\n\n';

    changelog.changes.forEach(change => {
      message +=
        '**' + change.type + '**: ' + change.title + '\n' +
        '    ' + change.msg + '\n' +
        '\n';
    });

    return {
      message: {message},
      context: context,
    };
  },
});

@@ -306,52 +306,356 @@
 %0A  f
-n: (argv, context) =%3E %7B%0A    let changelog = 
+lags: %5B%0A    %7B%0A      name: 'full-log',%0A      alias: 'f',%0A      desc: 'Return the full changelog instead of just the most recent',%0A      type: 'boolean',%0A      default: false,%0A    %7D%0A  %5D,%0A  fn: (argv, context) =%3E %7B%0A    let logsToRender = %5B%5D;%0A%0A    if (argv.flags%5B'full-log'%5D) %7B%0A      logsToRender = changelogs;%0A    %7D%0A    else %7B%0A      logsToRender.push(
 chan
@@ -663,17 +663,24 @@
 elogs%5B0%5D
-;
+);%0A    %7D
 %0A%0A    le
@@ -724,31 +724,87 @@
 h me
- since my last update (
+:%5Cn%5Cn';%0A%0A    logsToRender.forEach((changelog) =%3E %7B%0A      message += '**Version 
 ' + 
@@ -828,18 +828,19 @@
  + '
-):%5Cn
+**:
 %5Cn';%0A%0A
+  
     
@@ -875,32 +875,34 @@
 ange =%3E %7B%0A      
+ 
+ 
 message +=%0A     
@@ -904,19 +904,24 @@
         
-'**
+  '    (
 ' + chan
@@ -931,19 +931,17 @@
 type + '
-**:
+)
  ' + cha
@@ -963,25 +963,31 @@
 ' +%0A        
-'
+  '    
     ' + chan
@@ -999,26 +999,45 @@
 g + '%5Cn'
- +%0A       
+;%0A      %7D);%0A%0A      message +=
  '%5Cn';%0A 

add ablity to display the full log