fix: only add viewable channels to bot context (#7678)

Signed-off-by: The-Best-Codes <106822363+The-Best-Codes@users.noreply.github.com>
This commit is contained in:
BestCodes
2026-03-05 12:57:21 -06:00
committed by GitHub
parent 2f49bad19b
commit 5b038977b8
@@ -8,7 +8,7 @@ export async function buildServerContext(guild: Guild): Promise<string> {
const textChannels = Array.from(channels.values())
.filter(
(ch): ch is TextChannel =>
ch?.type === ChannelType.GuildText && ch !== null,
ch?.type === ChannelType.GuildText && ch !== null && ch.viewable,
)
.sort((a, b) => (a.position ?? 0) - (b.position ?? 0));