Fix say command failing when permissions are missing

Bot tries to delete the say message of the author, but if the bot does
not have permissions to delete messages, it will crash the bot.
This commit is contained in:
SileNce5k 2023-12-06 13:28:46 +01:00
parent dcbf3617a3
commit a82b62340e
No known key found for this signature in database
GPG key ID: 961132EB78C8915F

View file

@ -7,7 +7,11 @@ module.exports = {
message.channel.send("Can't send empty message");
else{
message.channel.send(args.join(" "))
try{
message.delete()
}catch{
console.log(this.name, ": An error happened while trying to delete the original message.\nProbably because of permissions.")
}
}
}