From 59e7f111622baa237fcb0d7d217d6e923eade4a8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Mar 2026 20:12:51 +0100 Subject: [PATCH] =?UTF-8?q?Notifications:=20guild.channels.fetch()=20statt?= =?UTF-8?q?=20.cache=20f=C3=BCr=20vollst=C3=A4ndige=20Channel-Liste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- server/src/plugins/notifications/index.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/server/src/plugins/notifications/index.ts b/server/src/plugins/notifications/index.ts index c78db4f..98afae8 100644 --- a/server/src/plugins/notifications/index.ts +++ b/server/src/plugins/notifications/index.ts @@ -197,15 +197,20 @@ const notificationsPlugin: Plugin = { for (const guild of ctx.client.guilds.cache.values()) { // Filter by allowed guilds if configured if (ctx.allowedGuildIds.length > 0 && !ctx.allowedGuildIds.includes(guild.id)) continue; - for (const channel of guild.channels.cache.values()) { - if (channel.type === ChannelType.GuildText) { - result.push({ - channelId: channel.id, - channelName: channel.name, - guildId: guild.id, - guildName: guild.name, - }); + try { + const channels = await guild.channels.fetch(); + for (const channel of channels.values()) { + if (channel && channel.type === ChannelType.GuildText) { + result.push({ + channelId: channel.id, + channelName: channel.name, + guildId: guild.id, + guildName: guild.name, + }); + } } + } catch (err) { + console.error(`${NB} Failed to fetch channels for guild ${guild.name}:`, err); } } res.json({ channels: result });