fix: reactions using unicode weren't processed

This commit is contained in:
cutestnekoaqua 2023-02-05 12:36:50 +01:00
parent f5f7493135
commit 9ca850be06
No known key found for this signature in database
GPG key ID: 6BF0964A5069C1E0

View file

@ -72,6 +72,13 @@ export async function toDbReaction(
// Convert old heart to new
if (reaction === "♥️") return "❤️";
// Allow unicode reactions
const match = emojiRegex.exec(reaction);
if (match) {
const unicode = match[0];
return unicode;
}
const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/);
if (custom) {
const name = custom[1];