{"size": 888, "ext": "js", "max_stars_repo_path": "commands/moderation/delete.js", "max_stars_repo_name": "SlimeBluKing/-GTX-Oscar", "max_stars_repo_stars_event_min_datetime": "2021-10-03T06:44:53.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-03T06:44:53.000Z", "max_issues_repo_path": "commands/moderation/delete.js", "max_issues_repo_name": "SlimeBluKing/-GTX-Oscar", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/moderation/delete.js", "max_forks_repo_name": "SlimeBluKing/-GTX-Oscar", "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.6451612903, "max_line_length": 130, "alphanum_fraction": 0.5686936937}
module.exports = {
    name: 'cancella',
    aliases: ['canc'],
    category: 'Moderazione',
    utilisation: '{prefix}cancella [numero]',

    async execute(client, message, args) {

        var messaggi = args[0];
        messaggi = parseInt(messaggi) + 1;


        if (!message.member.hasPermission("MANAGE_MESSAGES")) {
            message.channel.send('Non hai il permesso');
            return;
        }

        if (!message.guild.me.hasPermission("MANAGE_MESSAGES")) {
            message.channel.send('Non ho il permesso');
            return;
        }

        if (!args[0] || isNaN(args[0]) || args[0] === 'Infinity') return message.channel.send(`Ti prego metti un numero valido!`);

        message.channel.bulkDelete(messaggi, true)

        message.channel.send(args[0] + " messaggi eliminati").then(msg => {
            msg.delete({ timeout: 5000 })
        })
    },
};