"""Support""" the 'reactions' field on message objects

this is all really broken
This commit is contained in:
Christopher F
2016-10-31 21:00:35 -04:00
parent 838d60e2c2
commit 7018bc9c58
12 changed files with 128 additions and 7 deletions

View File

@@ -36,5 +36,7 @@ namespace Discord.API
public Optional<Embed[]> Embeds { get; set; }
[JsonProperty("pinned")]
public Optional<bool> Pinned { get; set; }
[JsonProperty("reactions")]
public Optional<Reaction[]> Reactions { get; set; }
}
}

View File

@@ -4,17 +4,15 @@ using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace Discord.API.Common
namespace Discord.API
{
public class Reaction
{
[JsonProperty("user_id")]
public ulong UserId { get; set; }
[JsonProperty("message_id")]
public ulong MessageId { get; set; }
[JsonProperty("count")]
public int Count { get; set; }
[JsonProperty("me")]
public bool Me { get; set; }
[JsonProperty("emoji")]
public Emoji Emoji { get; set; }
[JsonProperty("channel_id")]
public ulong ChannelId { get; set; }
}
}

View File

@@ -31,6 +31,8 @@ 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

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Discord
{
public interface IReaction
{
API.Emoji Emoji { get; }
}
}