Browse Source

Fixed tag parsing with incomplete tags

tags/1.0-rc
RogueException 8 years ago
parent
commit
7d1cae8ae8
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs

+ 5
- 4
src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs View File

@@ -110,11 +110,12 @@ namespace Discord.Rest
mentionedRole = guild.GetRole(id);
tags.Add(new Tag<IRole>(TagType.RoleMention, index, content.Length, id, mentionedRole));
}
else
else if (Emoji.TryParse(content, out var emoji))
tags.Add(new Tag<Emoji>(TagType.Emoji, index, content.Length, emoji.Id ?? 0, emoji));
else //Bad Tag
{
Emoji emoji;
if (Emoji.TryParse(content, out emoji))
tags.Add(new Tag<Emoji>(TagType.Emoji, index, content.Length, id, emoji));
index = index + 1;
continue;
}
index = endIndex + 1;
}


Loading…
Cancel
Save