From 51dbff6f287bc244b3faa191ee783e29bd910ff4 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 11 Mar 2023 14:47:54 -0500 Subject: [PATCH] Catch errors --- main.js | 3 +-- modules/functions.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 1ba7f95..199ea36 100755 --- a/main.js +++ b/main.js @@ -87,8 +87,7 @@ client.on('interactionCreate', async interaction => { }); client.on('messageUpdate', async message => { - await fn.sleep(50); - await fn.messages.updateHandler(message); + await fn.messages.updateHandler(message).catch(e => console.error(e)); }); async function checkRateLimits(hi) { diff --git a/modules/functions.js b/modules/functions.js index b793ef3..79cadd3 100755 --- a/modules/functions.js +++ b/modules/functions.js @@ -523,7 +523,7 @@ const functions = { }, async updateHandler(message) { if (message.partial) { - message = await message.fetch(); + message = await message.fetch().catch(e => console.error(e)); } // Make sure the message is from Grow A Tree if (message.author.id != strings.ids.growATree) return;