Browse Source

Update RestChannel for new channel types

pull/1923/head
quin lynch 3 years ago
parent
commit
622d3523ea
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/Discord.Net.Rest/Entities/Channels/RestChannel.cs

+ 8
- 1
src/Discord.Net.Rest/Entities/Channels/RestChannel.cs View File

@@ -24,7 +24,14 @@ namespace Discord.Rest
{
return model.Type switch
{
ChannelType.News or ChannelType.Text or ChannelType.Voice => RestGuildChannel.Create(discord, new RestGuild(discord, model.GuildId.Value), model),
ChannelType.News or
ChannelType.Text or
ChannelType.Voice or
ChannelType.Stage or
ChannelType.NewsThread or
ChannelType.PrivateThread or
ChannelType.PublicThread
=> RestGuildChannel.Create(discord, new RestGuild(discord, model.GuildId.Value), model),
ChannelType.DM or ChannelType.Group => CreatePrivate(discord, model) as RestChannel,
ChannelType.Category => RestCategoryChannel.Create(discord, new RestGuild(discord, model.GuildId.Value), model),
_ => new RestChannel(discord, model.Id),


Loading…
Cancel
Save