From e0e28c6dd10864385a43dfdaa47e320d1db1468f Mon Sep 17 00:00:00 2001 From: RogueException Date: Sat, 1 Apr 2017 21:49:34 -0300 Subject: [PATCH] Changed EmbedChannel's type to GuildChannel --- src/Discord.Net.Core/Entities/Guilds/IGuild.cs | 2 +- src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs | 9 +++------ src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs | 8 ++++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs index b3367fab5..6c7b73370 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs @@ -83,7 +83,7 @@ namespace Discord Task GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); - Task GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); + Task GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); /// Creates a new text channel. Task CreateTextChannelAsync(string name, RequestOptions options = null); /// Creates a new voice channel. diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs index e4e970487..15acef457 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs @@ -188,14 +188,11 @@ namespace Discord.Rest var channel = await GuildHelper.GetChannelAsync(this, Discord, DefaultChannelId, options).ConfigureAwait(false); return channel as RestTextChannel; } - public async Task GetEmbedChannelAsync(RequestOptions options = null) + public async Task GetEmbedChannelAsync(RequestOptions options = null) { var embedId = EmbedChannelId; if (embedId.HasValue) - { - var channel = await GuildHelper.GetChannelAsync(this, Discord, embedId.Value, options).ConfigureAwait(false); - return channel as RestVoiceChannel; - } + return await GuildHelper.GetChannelAsync(this, Discord, embedId.Value, options).ConfigureAwait(false); return null; } public Task CreateTextChannelAsync(string name, RequestOptions options = null) @@ -311,7 +308,7 @@ namespace Discord.Rest else return null; } - async Task IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) + async Task IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) { if (mode == CacheMode.AllowDownload) return await GetEmbedChannelAsync(options).ConfigureAwait(false); diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs index 04a94b421..9f106ff1c 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -69,12 +69,12 @@ namespace Discord.WebSocket return id.HasValue ? GetVoiceChannel(id.Value) : null; } } - public SocketVoiceChannel EmbedChannel + public SocketGuildChannel EmbedChannel { get { var id = EmbedChannelId; - return id.HasValue ? GetVoiceChannel(id.Value) : null; + return id.HasValue ? GetChannel(id.Value) : null; } } public IReadOnlyCollection TextChannels @@ -627,8 +627,8 @@ namespace Discord.WebSocket => Task.FromResult(AFKChannel); Task IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options) => Task.FromResult(DefaultChannel); - Task IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) - => Task.FromResult(EmbedChannel); + Task IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) + => Task.FromResult(EmbedChannel); async Task IGuild.CreateTextChannelAsync(string name, RequestOptions options) => await CreateTextChannelAsync(name, options).ConfigureAwait(false); async Task IGuild.CreateVoiceChannelAsync(string name, RequestOptions options)