Notifications: guild.channels.fetch() statt .cache für vollständige Channel-Liste
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1bcfef68fe
commit
59e7f11162
1 changed files with 13 additions and 8 deletions
|
|
@ -197,8 +197,10 @@ 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) {
|
||||
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,
|
||||
|
|
@ -207,6 +209,9 @@ const notificationsPlugin: Plugin = {
|
|||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`${NB} Failed to fetch channels for guild ${guild.name}:`, err);
|
||||
}
|
||||
}
|
||||
res.json({ channels: result });
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue