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:
parent
dcbf3617a3
commit
a82b62340e
1 changed files with 5 additions and 1 deletions
|
@ -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.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue