{"size": 1278, "ext": "js", "max_stars_repo_path": "commands/changelog.js", "max_stars_repo_name": "vaught-dawson/DELTA", "max_stars_repo_stars_event_min_datetime": "2022-01-14T05:22:14.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-14T18:24:55.000Z", "max_issues_repo_path": "commands/changelog.js", "max_issues_repo_name": "vaught-dawson/DELTA", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/changelog.js", "max_forks_repo_name": "vaught-dawson/DELTA", "max_forks_repo_forks_event_min_datetime": "2022-01-14T05:17:19.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-14T05:17:19.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 33.6315789474, "max_line_length": 106, "alphanum_fraction": 0.7089201878}
const logisticsTestingGuildId = '749775101435838554';
const vioDiscordId = '203944534839656448';
const servers = require('../information/guilds.json');
const Discord = require('discord.js');

module.exports = {
	name: 'changelog',
	aliases: [ 'change' ],
	description: 'Sends a change log to every DELTA server with an announcements channel set up (Dev Only).',
	args: true,
	guildOnly: true,
	commandChannel: false,
	async execute(message, args, server, client) {
		if (server.guildId != logisticsTestingGuildId) return;
		if (message.author.id != vioDiscordId) {
			return message.channel.send('Only Vio can run this!');
		}

		const embed = new Discord.MessageEmbed()
			.setTitle('Change Log')
			.setColor(15105570)
			.setAuthor('Vio', 'https://i.ibb.co/SyjyCdh/56dd1219215d46403de009a1c2b82bcd.png')
			.setDescription(args.join(' '))
			.setFooter('Resistance Logistics', 'https://i.ibb.co/Wzd001F/677a08d8682923ca8cb51fe48df38208.png');

		servers.guilds.forEach(async (server) => {
			if (server['announcementChannelId']) {
				if (!server['announcementChannelId'] == '') {
					let channel = await client.channels.fetch(server.announcementChannelId);
					channel.send(embed);
				}
			}
		});

		return message.channel.send('Success!').catch(console.error());
	}
};
