mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-01-11 08:01:03 -07:00
fix: heart reactions
This commit is contained in:
parent
0dab82ff57
commit
43b0e3f76e
2 changed files with 8 additions and 8 deletions
|
@ -7,7 +7,7 @@ import { IsNull } from 'typeorm';
|
||||||
|
|
||||||
const legacies: Record<string, string> = {
|
const legacies: Record<string, string> = {
|
||||||
'like': '👍',
|
'like': '👍',
|
||||||
'love': '❤', // ここに記述する場合は異体字セレクタを入れない
|
'love': '❤️', // ここに記述する場合は異体字セレクタを入れない <- not that good because modern browsers just display it as the red heart so just convert it to it to not end up with two seperate reactions of "the same emoji" for the user
|
||||||
'laugh': '😆',
|
'laugh': '😆',
|
||||||
'hmm': '🤔',
|
'hmm': '🤔',
|
||||||
'surprise': '😮',
|
'surprise': '😮',
|
||||||
|
@ -59,18 +59,18 @@ export async function toDbReaction(reaction?: string | null, reacterHost?: strin
|
||||||
|
|
||||||
reacterHost = toPunyNullable(reacterHost);
|
reacterHost = toPunyNullable(reacterHost);
|
||||||
|
|
||||||
// 文字列タイプのリアクションを絵文字に変換
|
// Convert string-type reactions to pictograms
|
||||||
if (Object.keys(legacies).includes(reaction)) return legacies[reaction];
|
if (Object.keys(legacies).includes(reaction)) return legacies[reaction];
|
||||||
|
|
||||||
// Unicode絵文字
|
// Unicode Pictograms
|
||||||
const match = emojiRegex.exec(reaction);
|
/*const match = emojiRegex.exec(reaction);
|
||||||
if (match) {
|
if (match) {
|
||||||
// 合字を含む1つの絵文字
|
// One pictogram with ligatures
|
||||||
const unicode = match[0];
|
const unicode = match[0];
|
||||||
|
|
||||||
// 異体字セレクタ除去
|
// variant character selector removal
|
||||||
return unicode.match('\u200d') ? unicode : unicode.replace(/\ufe0f/g, '');
|
return unicode.match('\u200d') ? unicode : unicode.replace(/\ufe0f/g, '');
|
||||||
}
|
}*/
|
||||||
|
|
||||||
const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/);
|
const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/);
|
||||||
if (custom) {
|
if (custom) {
|
||||||
|
|
|
@ -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"] },
|
||||||
|
|
Loading…
Reference in a new issue