Add SFW channels and link skip channels.

This commit is contained in:
Tarrgon
2025-06-04 22:52:08 -04:00
parent 11e3b3095a
commit f75b39484f
5 changed files with 144 additions and 23 deletions
+17 -1
View File
@@ -4,9 +4,25 @@ import { Database } from '../shared/Database';
export async function channelIsInStaffCategory(channel: GuildBasedChannel) {
if (!channel.guildId || !channel.parentId) return false;
const staffCategories = await Database.getGuildStaffCategories(channel.guildId);
const staffCategories = await Database.getGuildArraySetting('staff_categories', channel.guildId);
const parentChannel = await channel.guild.channels.fetch(channel.parentId);
return parentChannel?.parentId ? staffCategories.includes(parentChannel.parentId) : staffCategories.includes(channel.parentId);
}
export async function channelIsSafe(channel: GuildBasedChannel) {
if (!channel.guildId) return false;
const safeChannels = await Database.getGuildArraySetting('safe_channels', channel.guildId);
return safeChannels.includes(channel.id);
}
export async function channelIgnoresLinks(channel: GuildBasedChannel) {
if (!channel.guildId) return false;
const linkSkipChannels = await Database.getGuildArraySetting('link_skip_channels', channel.guildId);
return linkSkipChannels.includes(channel.id);
}