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("BACKUP_ERR_STATUS"));
}
if(status === "create"){
backup.create(message.guild).then((backupID) => {
message.channel.send(message.language.get("BACKUP_CREATE_SUCCESS"));
message.author.send(message.language.get("BACKUP_CREATE_SUCCESS_ID", backupID))
}).catch((err) => {
return message.channel.send(message.language.get("ERR_OCCURENCED"));
});
} else if (status === "load"){
let backupID = args[1];
if(!backupID){
return message.channel.send(message.language.get("BACKUP_ERR_ID"));
}
backup.fetch(backupID).then(async () => {
message.channel.send(message.language.get("BACKUP_CONFIRMATION"));
await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === "-confirm"), {
max: 1,
time: 20000,
errors: ["time"]