Added IMessage.Emojis
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
20
src/Discord.Net.Core/Entities/Messages/Emoji.cs
Normal file
20
src/Discord.Net.Core/Entities/Messages/Emoji.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user