@@ -6,8 +6,6 @@ using System.Threading.Tasks; | |||||
namespace Discord | namespace Discord | ||||
{ | { | ||||
//TODO: Add docstrings | |||||
//TODO: Docstrings should explain when REST requests are sent and how many | |||||
public interface IDiscordClient : IDisposable | public interface IDiscordClient : IDisposable | ||||
{ | { | ||||
ConnectionState ConnectionState { get; } | ConnectionState ConnectionState { get; } | ||||
@@ -4,8 +4,6 @@ using System.Threading.Tasks; | |||||
namespace Discord.Net.Queue | namespace Discord.Net.Queue | ||||
{ | { | ||||
//TODO: Allow user-supplied canceltoken | |||||
//TODO: Allow specifying timeout via DiscordApiClient | |||||
public interface IQueuedRequest | public interface IQueuedRequest | ||||
{ | { | ||||
CancellationToken CancelToken { get; } | CancellationToken CancelToken { get; } | ||||
@@ -5,7 +5,6 @@ using System.Threading.Tasks; | |||||
namespace Discord.Net.Rest | namespace Discord.Net.Rest | ||||
{ | { | ||||
//TODO: Add docstrings | |||||
public interface IRestClient | public interface IRestClient | ||||
{ | { | ||||
void SetHeader(string key, string value); | void SetHeader(string key, string value); | ||||
@@ -71,7 +71,9 @@ namespace Discord.Rest | |||||
public static IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(IChannel channel, BaseDiscordClient client, | public static IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(IChannel channel, BaseDiscordClient client, | ||||
ulong? fromMessageId, Direction dir, int limit, IGuild guild, RequestOptions options) | ulong? fromMessageId, Direction dir, int limit, IGuild guild, RequestOptions options) | ||||
{ | { | ||||
//TODO: Test this with Around direction | |||||
if (dir == Direction.Around) | |||||
throw new NotImplementedException(); //TODO: Impl | |||||
return new PagedAsyncEnumerable<RestMessage>( | return new PagedAsyncEnumerable<RestMessage>( | ||||
DiscordConfig.MaxMessagesPerBatch, | DiscordConfig.MaxMessagesPerBatch, | ||||
async (info, ct) => | async (info, ct) => | ||||
@@ -144,14 +144,14 @@ namespace Discord.Rest | |||||
=> await RemovePermissionOverwriteAsync(user, options).ConfigureAwait(false); | => await RemovePermissionOverwriteAsync(user, options).ConfigureAwait(false); | ||||
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
=> AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); //Overriden //Overriden in Text/Voice //TODO: Does this actually override? | |||||
=> AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); //Overriden //Overriden in Text/Voice | |||||
Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
=> Task.FromResult<IGuildUser>(null); //Overriden in Text/Voice //TODO: Does this actually override? | |||||
=> Task.FromResult<IGuildUser>(null); //Overriden in Text/Voice | |||||
//IChannel | //IChannel | ||||
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
=> AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overriden in Text/Voice //TODO: Does this actually override? | |||||
=> AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overriden in Text/Voice | |||||
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
=> Task.FromResult<IUser>(null); //Overriden in Text/Voice //TODO: Does this actually override? | |||||
=> Task.FromResult<IUser>(null); //Overriden in Text/Voice | |||||
} | } | ||||
} | } |
@@ -7,7 +7,6 @@ using System.Threading.Tasks; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
//TODO: Review this class | |||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")] | [DebuggerDisplay(@"{DebuggerDisplay,nq}")] | ||||
internal class RestVirtualMessageChannel : RestEntity<ulong>, IMessageChannel | internal class RestVirtualMessageChannel : RestEntity<ulong>, IMessageChannel | ||||
{ | { | ||||
@@ -153,8 +153,8 @@ namespace Discord.WebSocket | |||||
//IChannel | //IChannel | ||||
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
=> ImmutableArray.Create<IReadOnlyCollection<IUser>>(Users).ToAsyncEnumerable(); //Overriden in Text/Voice //TODO: Does this actually override? | |||||
=> ImmutableArray.Create<IReadOnlyCollection<IUser>>(Users).ToAsyncEnumerable(); //Overriden in Text/Voice | |||||
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
=> Task.FromResult<IUser>(GetUser(id)); //Overriden in Text/Voice //TODO: Does this actually override? | |||||
=> Task.FromResult<IUser>(GetUser(id)); //Overriden in Text/Voice | |||||
} | } | ||||
} | } |