Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run (message, args, data) {
let status = args[0];
if(!status){
return message.channel.send(message.language.get("GIVEAWAY_ERR_STATUS"));
}
if(status === "create"){
let currentGiveaways = giveaways.fetch().filter((g) => g.guildID === message.guild.id && !g.ended).length;
if(currentGiveaways > 3){
return message.channel.send(message.language.get("GIVEAWAY_ERR_MAX"));
}
let time = args[1];
if(!time){
return message.channel.send(message.language.get("GIVEAWAY_ERR_CREATE", data.settings.prefix));
}
if(isNaN(ms(time))){
return message.channel.send(message.language.get("ERR_INVALID_TIME"));
}
if(ms(time) > ms("15d")){
return message.channel.send(message.language.get("GIVEAWAY_ERR_15_DAYS"))
}
let winnersCount = args[2];
if(!winnersCount){
return message.channel.send(message.language.get("GIVEAWAY_ERR_CREATE", data.settings.prefix));