Fix threads not being in staff categories
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user