1
0
Fork 0
mirror of https://github.com/ChomeNS/chomens-bot-mc.git synced 2025-07-23 12:18:59 -04:00
chomens-bot-js/commands/changelog.js

42 lines
1.4 KiB
JavaScript
Raw Normal View History

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