Added IMessage.Emojis

This commit is contained in:
RogueException
2016-10-06 05:37:57 -03:00
parent 0b47d5bd2e
commit 9e982ccd4a
10 changed files with 115 additions and 51 deletions

View File

@@ -12,5 +12,7 @@
=> splashId != null ? $"{DiscordConfig.CDNUrl}splashes/{guildId}/{splashId}.jpg" : null;
public static string GetChannelIconUrl(ulong channelId, string iconId)
=> iconId != null ? $"{DiscordConfig.CDNUrl}channel-icons/{channelId}/{iconId}.jpg" : null;
public static string GetEmojiUrl(ulong emojiId)
=> $"{DiscordConfig.CDNUrl}emojis/{emojiId}.png";
}
}

View File

@@ -0,0 +1,20 @@
using Discord.API;
namespace Discord
{
public struct Emoji
{
public ulong Id { get; }
public string Name { get; }
public int Index { get; }
public string Url => CDN.GetEmojiUrl(Id);
internal Emoji(ulong id, string name, int index)
{
Id = id;
Name = name;
Index = index;
}
}
}

View File

@@ -27,6 +27,8 @@ namespace Discord
IReadOnlyCollection<IAttachment> Attachments { get; }
/// <summary> Returns a collection of all embeds included in this message. </summary>
IReadOnlyCollection<IEmbed> Embeds { get; }
/// <summary> Returns a collection of all custom emoji included in this message. </summary>
IReadOnlyCollection<Emoji> Emojis { get; }
/// <summary> Returns a collection of channel ids mentioned in this message. </summary>
IReadOnlyCollection<ulong> MentionedChannelIds { get; }
/// <summary> Returns a collection of roles mentioned in this message. </summary>