From 88379e4ab3a7ca305f9dcaee55d390545e4f8410 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:32:29 +1100 Subject: [PATCH] ignore error if word doesnt exist --- src/commands/bannedWords.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/bannedWords.ts b/src/commands/bannedWords.ts index bbff4a0..d30bcb8 100644 --- a/src/commands/bannedWords.ts +++ b/src/commands/bannedWords.ts @@ -8,7 +8,7 @@ export default { ({ add: async()=>{ if (wordExists) return interaction.reply({content: `\`${word}\` is already added.`, ephemeral: true}); - await client.bannedWords._content.create({_id:word}).then(a=>a.save()); + await client.bannedWords._content.create({_id:word}).then(a=>a.save()).catch(e=>{if (e.name == 'No document found for query') return}); interaction.reply(`Successfully added \`${word}\` to the database.`) }, remove: async()=>{