fix: Use ❤️ instead of ♥️

This commit is contained in:
cutestnekoaqua 2023-02-04 02:30:43 +01:00
parent 1a9dee792d
commit cc594a68aa
2 changed files with 10 additions and 9 deletions

View file

@ -35,6 +35,12 @@ export function convertLegacyReactions(reactions: Record<string, number>) {
} else { } else {
_reactions[legacies[reaction]] = reactions[reaction]; _reactions[legacies[reaction]] = reactions[reaction];
} }
} else if (reaction === "♥️") {
if (_reactions["❤️"]) {
_reactions["❤️"] += reactions[reaction];
} else {
_reactions["❤️"] = reactions[reaction];
}
} else { } else {
if (_reactions[reaction]) { if (_reactions[reaction]) {
_reactions[reaction] += reactions[reaction]; _reactions[reaction] += reactions[reaction];
@ -61,15 +67,10 @@ export async function toDbReaction(
reacterHost = toPunyNullable(reacterHost); reacterHost = toPunyNullable(reacterHost);
// 文字列タイプのリアクションを絵文字に変換 // Convert string-type reactions to unicode
if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; if (Object.keys(legacies).includes(reaction)) return legacies[reaction];
// Convert old heart to new
// Unicode絵文字 if (reaction === "♥️") return "❤️";
const match = emojiRegex.exec(reaction);
if (match) {
const unicode = match[0];
return unicode.match("\u200d") ? unicode : unicode.replace(/\ufe0f/g, "");
}
const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/); const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/);
if (custom) { if (custom) {

View file

@ -1496,7 +1496,7 @@
{ "category": "symbols", "char": "🀄", "name": "mahjong", "keywords": ["game", "play", "chinese", "kanji"] }, { "category": "symbols", "char": "🀄", "name": "mahjong", "keywords": ["game", "play", "chinese", "kanji"] },
{ "category": "symbols", "char": "♠️", "name": "spades", "keywords": ["poker", "cards", "suits", "magic"] }, { "category": "symbols", "char": "♠️", "name": "spades", "keywords": ["poker", "cards", "suits", "magic"] },
{ "category": "symbols", "char": "♣️", "name": "clubs", "keywords": ["poker", "cards", "magic", "suits"] }, { "category": "symbols", "char": "♣️", "name": "clubs", "keywords": ["poker", "cards", "magic", "suits"] },
{ "category": "symbols", "char": "", "name": "hearts", "keywords": ["poker", "cards", "magic", "suits"] }, { "category": "symbols", "char": "", "name": "hearts", "keywords": ["poker", "cards", "magic", "suits"] },
{ "category": "symbols", "char": "♦️", "name": "diamonds", "keywords": ["poker", "cards", "magic", "suits"] }, { "category": "symbols", "char": "♦️", "name": "diamonds", "keywords": ["poker", "cards", "magic", "suits"] },
{ "category": "symbols", "char": "🎴", "name": "flower_playing_cards", "keywords": ["game", "sunset", "red"] }, { "category": "symbols", "char": "🎴", "name": "flower_playing_cards", "keywords": ["game", "sunset", "red"] },
{ "category": "symbols", "char": "💭", "name": "thought_balloon", "keywords": ["bubble", "cloud", "speech", "thinking", "dream"] }, { "category": "symbols", "char": "💭", "name": "thought_balloon", "keywords": ["bubble", "cloud", "speech", "thinking", "dream"] },