Browse Source

fixed a bug in forum tag emoji parsing

pull/2469/head
Misha133 2 years ago
parent
commit
154430a870
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/Discord.Net.Core/Entities/ForumTags/ForumTag.cs
  2. +1
    -1
      src/Discord.Net.Core/Entities/ForumTags/ForumTagBuilder.cs

+ 2
- 2
src/Discord.Net.Core/Entities/ForumTags/ForumTag.cs View File

@@ -43,12 +43,12 @@ namespace Discord
/// </summary>
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);

internal ForumTag(ulong id, string name, ulong? emojiId, string? emojiName, bool moderated)
internal ForumTag(ulong id, string name, ulong? emojiId = null, string? emojiName = null, bool moderated = false)
{
if (emojiId.HasValue && emojiId.Value != 0)
Emoji = new Emote(emojiId.Value, null, false);
else if (emojiName != null)
Emoji = new Emoji(name);
Emoji = new Emoji(emojiName);
else
Emoji = null;



+ 1
- 1
src/Discord.Net.Core/Entities/ForumTags/ForumTagBuilder.cs View File

@@ -82,7 +82,7 @@ public class ForumTagBuilder
{
Name = name;
if(emoteId is not null)
Emoji = new Emote(emoteId.Value, string.Empty, false);
Emoji = new Emote(emoteId.Value, null, false);
IsModerated = moderated;
}



Loading…
Cancel
Save