{"size": 1349, "ext": "js", "max_stars_repo_path": "events/subevents/cuteNoLewd.js", "max_stars_repo_name": "kairusds/Alice", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "events/subevents/cuteNoLewd.js", "max_issues_repo_name": "kairusds/Alice", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "events/subevents/cuteNoLewd.js", "max_forks_repo_name": "kairusds/Alice", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.5428571429, "max_line_length": 218, "alphanum_fraction": 0.5596738325}
const picture_cooldown = new Set();

module.exports.run = (client, message) => {
    if (message.attachments.size > 1) message.delete().catch(console.error);

    const msgArray = message.content.split(/\s+/g);
    const images = [];
    for (let i = 0; i < msgArray.length; i++) {
        let part = msgArray[i];
        let length = part.length;
        if (!part.startsWith("http") && (part.indexOf("png", length - 3) === -1 && part.indexOf("jpg", length - 3) === -1 && part.indexOf("jpeg", length - 4) === -1 && part.indexOf("gif", length - 3) === -1)) continue;
        try {
            encodeURI(part)
        } catch (e) {
            continue
        }
        images.push(part)
    }
    if (images.length > 0 || message.attachments.size > 0) {
        if (picture_cooldown.has(message.author.id)) {
            client.commands.get("tempmute").run(client, message, [message.author.id, 600, `Please do not spam images in ${message.channel}!`])
        }
        else {
            picture_cooldown.add(message.author.id);
            setTimeout(() => {
                picture_cooldown.delete(message.author.id)
            }, 5000);
        }
        if (message.attachments.size <= 1) message.react("👍").then(() => message.react("👎").catch(console.error)).catch(console.error)
    }
};

module.exports.config = {
    name: "cuteNoLewd"
};