From a06ba9fef8741a58b860498fe1d2903de312a8fe Mon Sep 17 00:00:00 2001
From: Quin Lynch <49576606+quinchs@users.noreply.github.com>
Date: Tue, 11 Jan 2022 03:36:24 -0400
Subject: [PATCH] Make DefaultChannel exclude threads (#2031)
---
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
index 48b4bb5bc..711c4e930 100644
--- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
+++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
@@ -169,7 +169,7 @@ namespace Discord.WebSocket
/// A representing the first viewable channel that the user has access to.
///
public SocketTextChannel DefaultChannel => TextChannels
- .Where(c => CurrentUser.GetPermissions(c).ViewChannel)
+ .Where(c => CurrentUser.GetPermissions(c).ViewChannel && c is not IThreadChannel)
.OrderBy(c => c.Position)
.FirstOrDefault();
///