Skip to content

Commit 3be72a8

Browse files
authored
[Feature] Public constructor for Emote (#2936)
1 parent 531b5eb commit 3be72a8

File tree

1 file changed

+6
-1
lines changed
  • src/Discord.Net.Core/Entities/Emotes

1 file changed

+6
-1
lines changed

src/Discord.Net.Core/Entities/Emotes/Emote.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ public class Emote : IEmote, ISnowflakeEntity
3131
/// </returns>
3232
public string Url => CDN.GetEmojiUrl(Id, Animated);
3333

34-
internal Emote(ulong id, string name, bool animated)
34+
/// <summary>
35+
/// Creates a new instance of <see cref="Emote" />.
36+
/// </summary>
37+
public Emote(ulong id, string name, bool animated = false)
3538
{
39+
if (string.IsNullOrWhiteSpace(name))
40+
throw new ArgumentException("A custom emote must have a name", nameof(name));
3641
Id = id;
3742
Name = name;
3843
Animated = animated;

0 commit comments

Comments
 (0)