From 8cdf46464ee322e023f55f720e543c3aa9fe1d63 Mon Sep 17 00:00:00 2001
From: Hsu Still <341464@gmail.com>
Date: Mon, 16 Apr 2018 02:56:37 +0800
Subject: [PATCH] Cleanup emoji docs
---
docs/faq/basics/basic-operations.md | 2 +-
src/Discord.Net.Core/Entities/Emotes/Emoji.cs | 18 +++++--------
src/Discord.Net.Core/Entities/Emotes/Emote.cs | 26 +++++++------------
.../Entities/Emotes/GuildEmote.cs | 4 +--
.../Entities/Emotes/IEmote.cs | 8 ++----
5 files changed, 19 insertions(+), 39 deletions(-)
diff --git a/docs/faq/basics/basic-operations.md b/docs/faq/basics/basic-operations.md
index 94d4ed8fc..518a7426d 100644
--- a/docs/faq/basics/basic-operations.md
+++ b/docs/faq/basics/basic-operations.md
@@ -70,7 +70,7 @@ as in field values. With that in mind, links can be added with
Any entity that implements [IUserMessage] has an [AddReactionAsync]
method. This method expects an [IEmote] as a parameter.
-In Discord.Net, an Emote represents a server custom emote, while an
+In Discord.Net, an Emote represents a custom-image emote, while an
Emoji is a Unicode emoji (standard emoji). Both [Emoji] and [Emote]
implement [IEmote] and are valid options.
diff --git a/src/Discord.Net.Core/Entities/Emotes/Emoji.cs b/src/Discord.Net.Core/Entities/Emotes/Emoji.cs
index 1b2d7beb2..2315ae90f 100644
--- a/src/Discord.Net.Core/Entities/Emotes/Emoji.cs
+++ b/src/Discord.Net.Core/Entities/Emotes/Emoji.cs
@@ -1,22 +1,16 @@
namespace Discord
{
- ///
- /// A unicode emoji.
- ///
+ /// A Unicode emoji.
public class Emoji : IEmote
{
- // TODO: need to constrain this to unicode-only emojis somehow
-
- ///
- /// The unicode representation of this emote.
- ///
+ // TODO: need to constrain this to Unicode-only emojis somehow
+
+ /// Gets the Unicode representation of this emote.
public string Name { get; }
-
+ /// Gets the Unicode representation of this emote.
public override string ToString() => Name;
- ///
- /// Creates a unicode emoji.
- ///
+ /// Creates a Unicode emoji.
/// The pure UTF-8 encoding of an emoji
public Emoji(string unicode)
{
diff --git a/src/Discord.Net.Core/Entities/Emotes/Emote.cs b/src/Discord.Net.Core/Entities/Emotes/Emote.cs
index 6488e320d..762e8cec7 100644
--- a/src/Discord.Net.Core/Entities/Emotes/Emote.cs
+++ b/src/Discord.Net.Core/Entities/Emotes/Emote.cs
@@ -3,24 +3,18 @@ using System.Globalization;
namespace Discord
{
- ///
- /// A custom image-based emote.
- ///
+ /// A custom image-based emote.
public class Emote : IEmote, ISnowflakeEntity
{
- ///
- /// The display name (tooltip) of this emote.
- ///
+ /// Gets the display name (tooltip) of this emote.
public string Name { get; }
- ///
- /// The ID of this emote.
- ///
+ /// Gets the ID of this emote.
public ulong Id { get; }
- ///
- /// Is this emote animated?
- ///
+ /// Gets whether this emote animated?
public bool Animated { get; }
+ /// Gets the date when this emote is created.
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
+ /// Gets the image URL of this emote.
public string Url => CDN.GetEmojiUrl(Id, Animated);
internal Emote(ulong id, string name, bool animated)
@@ -49,16 +43,14 @@ namespace Discord
}
}
- ///
- /// Parses an Emote from its raw format.
- ///
- /// The raw encoding of an emote; for example, <:dab:277855270321782784>
+ /// Parses an from its raw format.
+ /// The raw encoding of an emote; for example, <:dab:277855270321782784>.
/// An emote
public static Emote Parse(string text)
{
if (TryParse(text, out Emote result))
return result;
- throw new ArgumentException("Invalid emote format", nameof(text));
+ throw new ArgumentException("Invalid emote format.", nameof(text));
}
public static bool TryParse(string text, out Emote result)
diff --git a/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs b/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs
index fec5519e5..7a6d3ac59 100644
--- a/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs
+++ b/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs
@@ -3,9 +3,7 @@ using System.Diagnostics;
namespace Discord
{
- ///
- /// An image-based emote that is attached to a guild.
- ///
+ /// An image-based emote that is attached to a guild.
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class GuildEmote : Emote
{
diff --git a/src/Discord.Net.Core/Entities/Emotes/IEmote.cs b/src/Discord.Net.Core/Entities/Emotes/IEmote.cs
index fac61402a..c4f3c2dfe 100644
--- a/src/Discord.Net.Core/Entities/Emotes/IEmote.cs
+++ b/src/Discord.Net.Core/Entities/Emotes/IEmote.cs
@@ -1,13 +1,9 @@
namespace Discord
{
- ///
- /// A general container for any type of emote in a message.
- ///
+ /// Represents a general container for any type of emote in a message.
public interface IEmote
{
- ///
- /// The display name or unicode representation of this emote
- ///
+ /// Gets the display name or Unicode representation of this emote.
string Name { get; }
}
}