Fix threads not being in staff categories

This commit is contained in:
Tarrgon
2025-06-04 13:57:08 -04:00
parent 798f4429a3
commit 403de9480e
+4 -2
View File
@@ -2,9 +2,11 @@ import { Channel, GuildBasedChannel, GuildChannel, GuildTextBasedChannel, TextBa
import { Database } from '../shared/Database';
export async function channelIsInStaffCategory(channel: GuildBasedChannel) {
if (!channel.guildId) return false;
if (!channel.guildId || !channel.parentId) return false;
const staffCategories = await Database.getGuildStaffCategories(channel.guildId);
return staffCategories.includes(channel.parentId!);
const parentChannel = await channel.guild.channels.fetch(channel.parentId);
return parentChannel?.parentId ? staffCategories.includes(parentChannel.parentId) : staffCategories.includes(channel.parentId);
}