Fixed tag parsing with incomplete tags
This commit is contained in:
@@ -110,11 +110,12 @@ namespace Discord.Rest
|
|||||||
mentionedRole = guild.GetRole(id);
|
mentionedRole = guild.GetRole(id);
|
||||||
tags.Add(new Tag<IRole>(TagType.RoleMention, index, content.Length, id, mentionedRole));
|
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;
|
index = index + 1;
|
||||||
if (Emoji.TryParse(content, out emoji))
|
continue;
|
||||||
tags.Add(new Tag<Emoji>(TagType.Emoji, index, content.Length, id, emoji));
|
|
||||||
}
|
}
|
||||||
index = endIndex + 1;
|
index = endIndex + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user