don't actually crash

This commit is contained in:
loicbersier 2019-08-12 14:05:39 +02:00
parent 8166a16a17
commit 4ab1eb3a2d

View file

@ -40,9 +40,10 @@ class fakebotCommand extends Command {
if (err) {
console.log(err);
}
return message.channel.send('Please run me again to send the message!');
});
});
}
} else {
let webhook = require(`../../webhook/${message.guild.id}.json`);
this.client.fetchWebhook(webhook.id, webhook.token)
.then(webhook => {
@ -50,9 +51,16 @@ class fakebotCommand extends Command {
name: args.member.username,
avatar: args.member.displayAvatarURL()
});
webhook.edit({
name: args.member.username,
avatar: args.member.displayAvatarURL()
});
message.delete();
return webhook.send(args.message);
});
}
}
}
module.exports = fakebotCommand;