Skip to content

Commit a06ba9f

Browse files
authored
Make DefaultChannel exclude threads (#2031)
1 parent cd36bb8 commit a06ba9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public class SocketGuild : SocketEntity<ulong>, IGuild, IDisposable
169169
/// A <see cref="SocketTextChannel"/> representing the first viewable channel that the user has access to.
170170
/// </returns>
171171
public SocketTextChannel DefaultChannel => TextChannels
172-
.Where(c => CurrentUser.GetPermissions(c).ViewChannel)
172+
.Where(c => CurrentUser.GetPermissions(c).ViewChannel && c is not IThreadChannel)
173173
.OrderBy(c => c.Position)
174174
.FirstOrDefault();
175175
/// <summary>

0 commit comments

Comments
 (0)