{"size": 1375, "ext": "js", "max_stars_repo_path": "src/commands/support/report.js", "max_stars_repo_name": "Coin-Flipper/Support-Flipper", "max_stars_repo_stars_event_min_datetime": "2021-07-30T16:29:32.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-30T16:29:32.000Z", "max_issues_repo_path": "src/commands/support/report.js", "max_issues_repo_name": "Coin-Flipper/Support-Flipper", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/commands/support/report.js", "max_forks_repo_name": "Coin-Flipper/Support-Flipper", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.0612244898, "max_line_length": 115, "alphanum_fraction": 0.6603636364}
const Discord = require('discord.js');

module.exports = {
	name: 'report',
	description: 'Submit a bug report to the Developers.',
	options: [
		{
			name: 'name',
			description: 'Bug report name:',
			type: 'STRING',
			required: true
		},
		{
			name: 'description',
			description: 'General explanation of the bug along with steps to reproduce.',
			type: 'STRING',
			required: true
		},
	],
	async execute(interaction, client) {

		await interaction.defer({ ephemeral: false });

		const name = interaction.options.get("name").value;
		const description = interaction.options.get("description").value;

		const embed = new Discord.MessageEmbed()
			.setTitle(`${name}`)
			.setDescription(`${description}`)
			.setColor('RED')
			.setAuthor({ name: `${interaction.member.user.tag}`, iconURL: `${interaction.member.user.displayAvatarURL()}` })
			.setFooter({ text: `ID: ${interaction.member.id}` })
			.setTimestamp();

		const channel = client.channels.cache.get(`870595027263443005`);
		channel.send({ embeds: [embed] }).catch(async (err) => {

			const error = new Discord.MessageEmbed()
				.setTitle('An error occured')
				.setColor('RED')
				.setDescription(`Sorry, I was unable to submit your report\n**${err}**`);

			await interaction.send({ embeds: [error] });
			return;
		});

		interaction.followUp({ content: 'Your report has been submitted.' });
	}
};