Make DefaultChannel exclude threads (#2031)

This commit is contained in:
Quin Lynch
2022-01-11 03:36:24 -04:00
committed by GitHub
parent cd36bb802b
commit a06ba9fef8

View File

@@ -169,7 +169,7 @@ namespace Discord.WebSocket
/// A <see cref="SocketTextChannel"/> representing the first viewable channel that the user has access to.
/// </returns>
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();
/// <summary>