/* eslint-disable max-len */ const changelog = require('../changelog.json'); const {MessageEmbed} = require('discord.js'); module.exports = { name: 'changelog', alias: ['changelogs'], description: 'Shows the bot\'s changelog', usage: '', trusted: 0, execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { const component = []; component.push({text: 'Changelogs ', color: 'green'}); component.push({text: '(', color: 'dark_gray'}); component.push({text: changelog.length, color: 'gray'}); component.push({text: ')', color: 'dark_gray'}); component.push({text: ':', color: 'gray'}); component.push('\n'); changelog.forEach((message, number) => { number += 1; component.push({text: number, color: 'gray'}); component.push({text: ' - ', color: 'dark_gray'}); component.push({text: message, color: 'gray'}); component.push('\n'); }); component.pop(); bot.tellraw(selector, component); }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { let changelogs = ''; changelog.forEach((message, number) => { number += 1; changelogs += `\`${number}\` - \`${message}\`` + '\n'; }); const Embed = new MessageEmbed() .setColor('#FFFF00') .setTitle(`Changelogs (${changelog.length})`) .setDescription(changelogs); channeldc.send({embeds: [Embed]}); }, };