From 19e585204502bcd69d7ad3744a223b562502002a Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Wed, 18 Oct 2023 09:20:53 -0700 Subject: [PATCH] fix/ignore undefined channels --- package.json | 2 +- structures/DayzRBot.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index dd8becc..1a5e306 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "10.4.2", + "version": "10.4.3", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": { diff --git a/structures/DayzRBot.js b/structures/DayzRBot.js index 61a936e..3196104 100644 --- a/structures/DayzRBot.js +++ b/structures/DayzRBot.js @@ -161,6 +161,7 @@ class DayzRBot extends Client { // Handle alarm pings for (const [channel_id, data] of Object.entries(this.alarmPingQueue)) { const channel = this.GetChannel(channel_id); + if (!channel) continue; for (const [role, embeds] of Object.entries(data)) { if (role == '-no-role-ping-') channel.send({ embeds: embeds }); else channel.send({ content: `<@&${role}>`, embeds: embeds });