From 8878ac76e883896db49b63d10e219224b725f041 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 11 Jan 2025 11:02:39 -0500 Subject: [PATCH] Add some custom error messages for perms and length of nick --- slash-commands/setnick.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slash-commands/setnick.js b/slash-commands/setnick.js index f778c9a..f86b713 100644 --- a/slash-commands/setnick.js +++ b/slash-commands/setnick.js @@ -30,6 +30,12 @@ module.exports = { await interaction.editReply(`Successfully set ${user}'s nickname to ${nickname}`); } catch (error) { console.error(error); + if (error.code === 50013) { + return await interaction.editReply('I do not have permission to set the nickname of that user!'); + } + if (error.code === 50035) { + return await interaction.editReply('The nickname is too long!'); + } await interaction.editReply('There was an error while executing this command!'); } },