@@ -83,7 +83,7 @@ namespace Discord | |||||
Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||||
Task<IVoiceChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | |||||
Task<IGuildChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | |||||
/// <summary> Creates a new text channel. </summary> | /// <summary> Creates a new text channel. </summary> | ||||
Task<ITextChannel> CreateTextChannelAsync(string name, RequestOptions options = null); | Task<ITextChannel> CreateTextChannelAsync(string name, RequestOptions options = null); | ||||
/// <summary> Creates a new voice channel. </summary> | /// <summary> Creates a new voice channel. </summary> | ||||
@@ -188,14 +188,11 @@ namespace Discord.Rest | |||||
var channel = await GuildHelper.GetChannelAsync(this, Discord, DefaultChannelId, options).ConfigureAwait(false); | var channel = await GuildHelper.GetChannelAsync(this, Discord, DefaultChannelId, options).ConfigureAwait(false); | ||||
return channel as RestTextChannel; | return channel as RestTextChannel; | ||||
} | } | ||||
public async Task<RestVoiceChannel> GetEmbedChannelAsync(RequestOptions options = null) | |||||
public async Task<RestGuildChannel> GetEmbedChannelAsync(RequestOptions options = null) | |||||
{ | { | ||||
var embedId = EmbedChannelId; | var embedId = EmbedChannelId; | ||||
if (embedId.HasValue) | 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; | return null; | ||||
} | } | ||||
public Task<RestTextChannel> CreateTextChannelAsync(string name, RequestOptions options = null) | public Task<RestTextChannel> CreateTextChannelAsync(string name, RequestOptions options = null) | ||||
@@ -311,7 +308,7 @@ namespace Discord.Rest | |||||
else | else | ||||
return null; | return null; | ||||
} | } | ||||
async Task<IVoiceChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) | |||||
async Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) | |||||
{ | { | ||||
if (mode == CacheMode.AllowDownload) | if (mode == CacheMode.AllowDownload) | ||||
return await GetEmbedChannelAsync(options).ConfigureAwait(false); | return await GetEmbedChannelAsync(options).ConfigureAwait(false); | ||||
@@ -69,12 +69,12 @@ namespace Discord.WebSocket | |||||
return id.HasValue ? GetVoiceChannel(id.Value) : null; | return id.HasValue ? GetVoiceChannel(id.Value) : null; | ||||
} | } | ||||
} | } | ||||
public SocketVoiceChannel EmbedChannel | |||||
public SocketGuildChannel EmbedChannel | |||||
{ | { | ||||
get | get | ||||
{ | { | ||||
var id = EmbedChannelId; | var id = EmbedChannelId; | ||||
return id.HasValue ? GetVoiceChannel(id.Value) : null; | |||||
return id.HasValue ? GetChannel(id.Value) : null; | |||||
} | } | ||||
} | } | ||||
public IReadOnlyCollection<SocketTextChannel> TextChannels | public IReadOnlyCollection<SocketTextChannel> TextChannels | ||||
@@ -627,8 +627,8 @@ namespace Discord.WebSocket | |||||
=> Task.FromResult<IVoiceChannel>(AFKChannel); | => Task.FromResult<IVoiceChannel>(AFKChannel); | ||||
Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options) | Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options) | ||||
=> Task.FromResult<ITextChannel>(DefaultChannel); | => Task.FromResult<ITextChannel>(DefaultChannel); | ||||
Task<IVoiceChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) | |||||
=> Task.FromResult<IVoiceChannel>(EmbedChannel); | |||||
Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options) | |||||
=> Task.FromResult<IGuildChannel>(EmbedChannel); | |||||
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, RequestOptions options) | async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, RequestOptions options) | ||||
=> await CreateTextChannelAsync(name, options).ConfigureAwait(false); | => await CreateTextChannelAsync(name, options).ConfigureAwait(false); | ||||
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, RequestOptions options) | async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, RequestOptions options) | ||||