chomens-bot-js/commands/changelog.js

42 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-11-27 02:35:28 -05:00
const changelog = require('../changelog.json')
const { MessageEmbed } = require('discord.js')
2022-08-14 05:51:45 -04:00
module.exports = {
name: 'changelog',
alias: ['changelogs'],
description: 'Shows the bot\'s changelog',
usage: '',
trusted: 0,
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
2022-11-27 02:35:28 -05:00
const component = []
2022-11-18 03:45:29 -05:00
2022-11-27 02:35:28 -05:00
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')
2022-08-14 05:51:45 -04:00
changelog.forEach((message, number) => {
2022-11-27 02:35:28 -05:00
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()
2022-11-18 03:45:29 -05:00
2022-11-27 02:35:28 -05:00
bot.tellraw(selector, component)
2022-08-14 05:51:45 -04:00
},
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
2022-11-27 02:35:28 -05:00
let changelogs = ''
2022-08-14 05:51:45 -04:00
changelog.forEach((message, number) => {
2022-11-27 02:35:28 -05:00
number += 1
changelogs += `\`${number}\` - \`${message}\`` + '\n'
})
2022-08-14 05:51:45 -04:00
const Embed = new MessageEmbed()
2022-12-01 05:15:30 -05:00
.setColor(config.discord.embedsColors.normal)
2022-11-27 02:35:28 -05:00
.setTitle(`Changelogs (${changelog.length})`)
.setDescription(changelogs)
channeldc.send({ embeds: [Embed] })
}
}