From 2704cac98f28a9826bd52d3f087c1d0191c8842a Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 3 Jun 2023 15:45:11 -0400 Subject: [PATCH] Fix for embeds w/o descriptions crashing the bot --- modules/functions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/functions.js b/modules/functions.js index 93b9e9d..527186b 100755 --- a/modules/functions.js +++ b/modules/functions.js @@ -861,6 +861,8 @@ const functions = { // If the message doesn't contain an embed, we can ignore it if (message.embeds == undefined) return; if (message.embeds.length == 0) return; + if (message.embeds.data == undefined) return; + if (message.embeds.data.description == undefined) return; // Check the description field of the embed to determine if it matches Grow A Tree's notification texts if (message.embeds[0].data.description.includes(strings.notifications.water)) { functions.sendWaterReminder(guildInfo, guildInfo.waterMessage, guildInfo.reminderChannelId, guild);