fix: allow the Util#parseEmoji regex to match emoji identifier (#2229)

This commit is contained in:
SpaceEEC
2018-01-04 20:29:32 +01:00
committed by Crawl
parent 780a311c0a
commit 2318812f7f

View File

@@ -78,7 +78,7 @@ class Util {
static parseEmoji(text) {
if (text.includes('%')) text = decodeURIComponent(text);
if (!text.includes(':')) return { animated: false, name: text, id: null };
const m = text.match(/<?(a)?:(\w{2,32}):(\d{17,19})>?/);
const m = text.match(/<?(a)?:?(\w{2,32}):(\d{17,19})>?/);
if (!m) return null;
return { animated: Boolean(m[1]), name: m[2], id: m[3] };
}