From d0c10018f32aff659ef12152b838222da4829e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Tue, 7 Sep 2021 15:36:33 +0300 Subject: [PATCH] Updated messageCreate event --- src/client/events/messageCreate.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/events/messageCreate.js b/src/client/events/messageCreate.js index ccd314f..0f8b9d6 100644 --- a/src/client/events/messageCreate.js +++ b/src/client/events/messageCreate.js @@ -41,8 +41,11 @@ module.exports = { let msg = await message.channel.send({ embeds: [embed] }); - setTimeout(function() { - msg.delete(); + setTimeout(async function() { + try { + await msg.delete(); + } catch (DiscordAPIError) { + } }, 30000); } catch (error) { message.reply({