mirror of
https://github.com/syuilo/ai.git
synced 2024-11-09 15:38:00 +00:00
parent
d1c0087986
commit
f7ca0bb726
|
@ -13,12 +13,12 @@
|
|||
"@types/random-seed": "0.3.3",
|
||||
"@types/request-promise-native": "1.0.17",
|
||||
"@types/seedrandom": "2.4.28",
|
||||
"@types/twemoji-parser": "12.1.0",
|
||||
"@types/uuid": "8.3.0",
|
||||
"@types/ws": "7.2.6",
|
||||
"autobind-decorator": "2.4.0",
|
||||
"canvas": "2.6.1",
|
||||
"chalk": "4.1.0",
|
||||
"emoji-regex": "9.0.0",
|
||||
"lokijs": "1.5.11",
|
||||
"mecab-async": "0.1.2",
|
||||
"misskey-reversi": "0.0.5",
|
||||
|
@ -30,6 +30,7 @@
|
|||
"seedrandom": "3.0.5",
|
||||
"timeout-as-promise": "1.0.0",
|
||||
"ts-node": "9.0.0",
|
||||
"twemoji-parser": "13.0.0",
|
||||
"typescript": "4.0.2",
|
||||
"uuid": "8.3.0",
|
||||
"ws": "7.3.1"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import autobind from 'autobind-decorator';
|
||||
const emojiRegex = require('emoji-regex');
|
||||
import { parse } from 'twemoji-parser';
|
||||
|
||||
import { Note } from '../../misskey/note';
|
||||
import Module from '../../module';
|
||||
|
@ -44,8 +44,8 @@ export default class extends Module {
|
|||
return react(customEmojis[0]);
|
||||
}
|
||||
|
||||
const emojis = note.text.match(emojiRegex());
|
||||
if (emojis) {
|
||||
const emojis = parse(note.text).map(x => x.text);
|
||||
if (emojis.length > 0) {
|
||||
// 絵文字が複数種類ある場合はキャンセル
|
||||
if (!emojis.every((val, i, arr) => val === arr[0])) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue