{"size": 979, "ext": "js", "max_stars_repo_path": "src/events/config/guildRoleCreate.js", "max_stars_repo_name": "codacy-badger/lostbot", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/events/config/guildRoleCreate.js", "max_issues_repo_name": "codacy-badger/lostbot", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/events/config/guildRoleCreate.js", "max_forks_repo_name": "codacy-badger/lostbot", "max_forks_repo_forks_event_min_datetime": "2021-12-12T15:24:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-12T15:24:36.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 27.1944444444, "max_line_length": 77, "alphanum_fraction": 0.5536261491}
module.exports = async (client, guild, role) => {
	let oa = require('../../models/Guild');
	let Guild = await oa.findOne({ id: guild.id });
	let d = Guild.logs.action.channel;
	if (guild.id === d) return;
	if (!d || !Guild.logs.action.enabled) return;
	let ba = await guild.getAuditLogs(1, null, 30).then((e) => e.entries[0]);
	let by = ba.user.id;
	client.createMessage(`${d}`, {
		embed: {
			title: 'Role Created',
			description: `A role was created by <@!${by}>.`,
			author: { name: `|  ${guild.name}`, icon_url: guild.iconURL },
			color: 0x10eb23,
			fields: [
				{
					name: 'Name',
					value: role.name,
					inline: true
				},
				{
					name: 'Features',
					value: `**Mentionable:** ${role.mentionable
						? 'True'
						: 'False'}\n**Position:** ${role.position}\n**Managed:** ${role.managed
						? 'True'
						: 'False'}\n**Colour:** ${role.color}`,
					inline: true
				}
			],
			footer: { text: `ID ${role.id}` },
			timestamp: new Date()
		}
	});
};
