From a82b62340e34b726b2cb57807412cfe8bd33e823 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 6 Dec 2023 13:28:46 +0100 Subject: [PATCH] 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. --- commands/misc/say.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/misc/say.js b/commands/misc/say.js index d1c7390..69fd0a4 100644 --- a/commands/misc/say.js +++ b/commands/misc/say.js @@ -7,7 +7,11 @@ module.exports = { message.channel.send("Can't send empty message"); else{ message.channel.send(args.join(" ")) - message.delete() + try{ + message.delete() + }catch{ + console.log(this.name, ": An error happened while trying to delete the original message.\nProbably because of permissions.") + } } }