Renamed RelativeDirection to Relative

This commit is contained in:
RogueException
2016-01-17 19:50:58 -04:00
parent a3735f2210
commit 2efcd3675d
5 changed files with 12 additions and 17 deletions

View File

@@ -535,8 +535,8 @@
<Compile Include="..\Discord.Net\ProfileEventArgs.cs">
<Link>ProfileEventArgs.cs</Link>
</Compile>
<Compile Include="..\Discord.Net\RelativeDirection.cs">
<Link>RelativeDirection.cs</Link>
<Compile Include="..\Discord.Net\Relative.cs">
<Link>Relative.cs</Link>
</Compile>
<Compile Include="..\Discord.Net\RoleEventArgs.cs">
<Link>RoleEventArgs.cs</Link>

View File

@@ -163,7 +163,7 @@ namespace Discord.Legacy
}
[Obsolete("Use Channel.DownloadMessages")]
public static Task<Message[]> DownloadMessages(this DiscordClient client, Channel channel, int limit = 100, ulong? relativeMessageId = null, RelativeDirection relativeDir = RelativeDirection.Before, bool useCache = true)
public static Task<Message[]> DownloadMessages(this DiscordClient client, Channel channel, int limit = 100, ulong? relativeMessageId = null, Relative relativeDir = Relative.Before, bool useCache = true)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
return channel.DownloadMessages(limit, relativeMessageId, relativeDir, useCache);

View File

@@ -283,7 +283,7 @@ namespace Discord
}
public async Task<Message[]> DownloadMessages(int limit = 100, ulong? relativeMessageId = null,
RelativeDirection relativeDir = RelativeDirection.Before, bool useCache = true)
Relative relativeDir = Relative.Before, bool useCache = true)
{
if (limit < 0) throw new ArgumentOutOfRangeException(nameof(limit));
if (limit == 0 || Type != ChannelType.Text) return new Message[0];
@@ -293,7 +293,7 @@ namespace Discord
var request = new GetMessagesRequest(Id)
{
Limit = limit,
RelativeDir = relativeMessageId.HasValue ? relativeDir == RelativeDirection.Before ? "before" : "after" : null,
RelativeDir = relativeMessageId.HasValue ? relativeDir == Relative.Before ? "before" : "after" : null,
RelativeId = relativeMessageId ?? 0
};
var msgs = await Client.ClientAPI.Send(request).ConfigureAwait(false);

View File

@@ -0,0 +1,7 @@
namespace Discord
{
public enum Relative
{
Before, After
}
}

View File

@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Discord
{
public enum RelativeDirection
{
Before, After
}
}