Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if(status === "reroll"){
let messageID = args[1];
if(!messageID){
return message.channel.send(message.language.get("GIVEAWAY_ERR_REROLL"));
}
giveaways.reroll(messageID, message.language.get("GIVEAWAY_REROLL_MESSAGES")).then(() => {
return message.channel.send(message.language.get("GIVEAWAY_REROLLED"));
}).catch((err) => {
return message.channel.send(message.language.get("GIVEAWAY_ERR_REROLL_MSG_ENDED", messageID));
});
} else if(status === "delete"){
let messageID = args[1];
if(!messageID){
return message.channel.send(message.language.get("GIVEAWAY_ERR_DELETE"));
}
giveaways.delete(messageID).then(() => {
return message.channel.send(message.language.get("GIVEAWAY_DELETED"));
}).catch((err) => {
return message.channel.send(message.language.get("GIVEAWAY_ERR_MESSAGE_NOT_FOUND", messageID));
});
} else if(status === "end"){
let messageID = args[1];
if(!messageID){
return message.channel.send(message.language.get("GIVEAWAY_ERR_END"));
}
try {
giveaways.edit(messageID, {
setEndTimestamp: Date.now()
});
return message.channel.send(message.language.get("GIVEAWAY_ENDED"));
} catch(e){
return message.channel.send(message.language.get("GIVEAWAY_ERR_MESSAGE_NOT_FOUND", messageID));