ai icon indicating copy to clipboard operation
ai copied to clipboard

リアクションの反応が過剰気味

Open YuzuRyo61 opened this issue 3 years ago • 2 comments

改行を除く全ての文字列で:で囲ったらリアクション反応してしまう。

https://github.com/syuilo/ai/blob/d5a34144f0159735a5031954d0d6489ce188c66c/src/modules/emoji-react/index.ts#L39

/:([a-zA-Z0-9_\-]+):/g でも十分な気がします。

反応例: https://misskey.io/notes/8ett9aa32l

:Volte を購入しました。 https: で反応している

YuzuRyo61 avatar Nov 20 '20 13:11 YuzuRyo61

Noteが投稿されたときにemojisの配列があるので、そこから取り出しても良さそうな気もします。

YuzuRyo61 avatar Nov 21 '20 05:11 YuzuRyo61

sorry for English

Regarding matching on http:// accidentally, I altered index.ts with this line const customEmojis = note.text.match(/:(?!.*http[s]?:\/\/)([^\n:]+?):/g);

Although you indicate that there are other variation that would match in error too.

blackskye-sx avatar Nov 26 '21 01:11 blackskye-sx