{"size": 1770, "ext": "js", "max_stars_repo_path": "commands/anime/aianime.js", "max_stars_repo_name": "diegohgaona/JinYasashi", "max_stars_repo_stars_event_min_datetime": "2021-02-20T06:58:31.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-28T01:36:47.000Z", "max_issues_repo_path": "commands/anime/aianime.js", "max_issues_repo_name": "diegohgaona/JinYasashi", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/anime/aianime.js", "max_forks_repo_name": "diegohgaona/JinYasashi", "max_forks_repo_forks_event_min_datetime": "2021-02-20T09:28:31.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-20T09:28:31.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.6, "max_line_length": 158, "alphanum_fraction": 0.5627118644}
module.exports = {
	name: 'aianime',
	aliases: ['animedne'],
	desc:
		'Like aiwaifu but with this command you can choose the creativity and the seed (Creativiy: minimum 0.3, maximum: 2.0 ~ Seed: minimum 10000, maximum 99999)',
	cat: 'anime',
	cooldown: 7,
	run: async (bot, msg, args, prefix) => {
		let seed, creativiy, description;
		if (!args[0] || isNaN(args[0]) || args[0] < 10000 || args[0] > 99999) {
			seed = {
				seed: Math.floor(Math.random() * 99999 + 10000).toString(),
				good: true
			};
			if(seed.seed > 99999) {
			  seed = {
				seed: seed.seed -= 10000,
				good: true
			};
			}
		} else {
			seed = {
				seed: Math.floor(args[0]),
				good: false
			};
		}

		if (!args[1] || isNaN(args[1]) || args[1] < 0.3 || args[1] > 2.0) {
			creativiy = {
				creativiy: (Math.random() * 2.0 + 0.3).toString().slice(0, 3),
				good: true
			};
		} else {
			creativiy = {
				creativiy: args[1],
				good: false
			};
		}
		if (args[1] == '1' || args[1] == '2') {
			creativiy = {
				creativiy: args[1] + '.0',
				good: false
			};
		}
		let img = `https://thisanimedoesnotexist.ai/results/psi-${
			creativiy.creativiy
		}/seed${seed.seed}.png`;
		
		if (!seed.good || !creativiy.creativiy) {
			description = null;
		} else {
			description =
				'Usage: `aianime [Seed (10000 ~ 99999)] [Creativiy (0.3 ~ 2.0)]`\n\nSeed: `'+seed.seed+'` Creativity: `'+creativiy.creativiy+'`';
		}
		await msg.channel.createMessage({
			embed: {
				color: bot.color,
				author: {
					name: msg.author.username,
					icon_url: msg.author.avatarURL
				},
				description: description,
				image: {
					url: img
				},
				footer: {
					text: 'https://thisanimedoesnotexist.ai/',
					icon_url: msg.author.avatarURL
				},
				timestamp: new Date()
			}
		});
	}
};
