Fix FakeNitro hyperlinks not working sometimes

It is caused by emoji names with conflict with default emojis, but have a letter capitalized
main
Nuckyz 9 months ago
parent 46ee193cd0
commit 93b2095d71
No known key found for this signature in database
GPG Key ID: 440BF8296E1C4AD9

@ -838,7 +838,7 @@ export default definePlugin({
url.searchParams.set("name", emoji.name);
messageObj.content = messageObj.content.replace(emojiString, (match, offset, origStr) => {
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[:${emoji.name}:](${url})` : url}${getWordBoundary(origStr, offset + match.length)}`;
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[${emoji.name}](${url})` : url}${getWordBoundary(origStr, offset + match.length)}`;
});
}
}
@ -864,7 +864,7 @@ export default definePlugin({
url.searchParams.set("size", s.emojiSize.toString());
url.searchParams.set("name", emoji.name);
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[:${emoji.name}:](${url})` : url}${getWordBoundary(origStr, offset + emojiStr.length)}`;
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[${emoji.name}](${url})` : url}${getWordBoundary(origStr, offset + emojiStr.length)}`;
});
});
},

Loading…
Cancel
Save