Refactor, rearrange, reimplement reactions; receive over gateway

This commit is contained in:
Christopher F
2016-11-05 18:15:47 -04:00
parent 7018bc9c58
commit e2e2c4308d
15 changed files with 96 additions and 41 deletions

View File

@@ -19,6 +19,11 @@ namespace Discord
Name = name;
}
internal static Emoji FromApi(API.Emoji emoji)
{
return new Emoji(emoji.Id, emoji.Name);
}
public static Emoji Parse(string text)
{
Emoji result;

View File

@@ -31,8 +31,6 @@ namespace Discord
IReadOnlyCollection<IAttachment> Attachments { get; }
/// <summary> Returns all embeds included in this message. </summary>
IReadOnlyCollection<IEmbed> Embeds { get; }
/// <summary> Returns all reactions included in this message. </summary>
IReadOnlyCollection<IReaction> Reactions { get; }
/// <summary> Returns all tags included in this message's content. </summary>
IReadOnlyCollection<ITag> Tags { get; }
/// <summary> Returns the ids of channels mentioned in this message. </summary>

View File

@@ -7,6 +7,6 @@ namespace Discord
{
public interface IReaction
{
API.Emoji Emoji { get; }
Emoji Emoji { get; }
}
}

View File

@@ -14,6 +14,9 @@ namespace Discord
/// <summary> Removes this message from its channel's pinned messages. </summary>
Task UnpinAsync(RequestOptions options = null);
/// <summary> Returns all reactions included in this message. </summary>
IReadOnlyDictionary<Emoji, int> Reactions { get; }
/// <summary> Adds a reaction to this message. </summary>
Task AddReactionAsync(Emoji emoji, RequestOptions options = null);
/// <summary> Adds a reaction to this message. </summary>