fix/ignore undefined channels

This commit is contained in:
SowinskiBraeden committed 2023-10-18 09:20:53 -07:00
1 parent 5b5c5fa82c
commit 19e5852045
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayzr-bot", "name": "dayzr-bot",
"version": "10.4.2", "version": "10.4.3",
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
"main": "index.js", "main": "index.js",
"nodemonConfig": { "nodemonConfig": {
+1
View File
@@ -161,6 +161,7 @@ class DayzRBot extends Client {
// Handle alarm pings // Handle alarm pings
for (const [channel_id, data] of Object.entries(this.alarmPingQueue)) { for (const [channel_id, data] of Object.entries(this.alarmPingQueue)) {
const channel = this.GetChannel(channel_id); const channel = this.GetChannel(channel_id);
if (!channel) continue;
for (const [role, embeds] of Object.entries(data)) { for (const [role, embeds] of Object.entries(data)) {
if (role == '-no-role-ping-') channel.send({ embeds: embeds }); if (role == '-no-role-ping-') channel.send({ embeds: embeds });
else channel.send({ content: `<@&${role}>`, embeds: embeds }); else channel.send({ content: `<@&${role}>`, embeds: embeds });