2018-08-11 06:53:49 +00:00
|
|
|
import 藍 from '../../ai';
|
|
|
|
import IModule from '../../module';
|
|
|
|
import MessageLike from '../../message-like';
|
|
|
|
import serifs from '../../serifs';
|
|
|
|
|
|
|
|
const hands = [
|
|
|
|
'👏',
|
|
|
|
'👍',
|
|
|
|
'👎',
|
|
|
|
'👊',
|
|
|
|
'✊',
|
|
|
|
['🤛', '🤜'],
|
|
|
|
['🤜', '🤛'],
|
|
|
|
'🤞',
|
|
|
|
'✌',
|
|
|
|
'🤟',
|
|
|
|
'🤘',
|
|
|
|
'👌',
|
|
|
|
'👈',
|
|
|
|
'👉',
|
|
|
|
['👈', '👉'],
|
|
|
|
['👉', '👈'],
|
|
|
|
'👆',
|
|
|
|
'👇',
|
|
|
|
'☝',
|
|
|
|
['✋', '🤚'],
|
|
|
|
'🖐',
|
|
|
|
'🖖',
|
|
|
|
'👋',
|
|
|
|
'🤙',
|
|
|
|
'💪',
|
|
|
|
'🖕'
|
|
|
|
]
|
|
|
|
|
|
|
|
const faces = [
|
|
|
|
'😀',
|
|
|
|
'😃',
|
|
|
|
'😄',
|
|
|
|
'😁',
|
|
|
|
'😆',
|
|
|
|
'😅',
|
|
|
|
'😂',
|
|
|
|
'🤣',
|
2018-08-11 07:47:36 +00:00
|
|
|
'☺️',
|
|
|
|
'😊',
|
2018-08-11 06:53:49 +00:00
|
|
|
'😇',
|
|
|
|
'🙂',
|
|
|
|
'🙃',
|
|
|
|
'😉',
|
|
|
|
'😌',
|
|
|
|
'😍',
|
|
|
|
'😘',
|
|
|
|
'😗',
|
|
|
|
'😙',
|
|
|
|
'😚',
|
|
|
|
'😋',
|
|
|
|
'😛',
|
|
|
|
'😝',
|
|
|
|
'😜',
|
|
|
|
'🤪',
|
|
|
|
'🤨',
|
|
|
|
'🧐',
|
|
|
|
'🤓',
|
|
|
|
'😎',
|
|
|
|
'🤩',
|
|
|
|
'😏',
|
|
|
|
'😒',
|
|
|
|
'😞',
|
|
|
|
'😔',
|
|
|
|
'😟',
|
|
|
|
'😕',
|
|
|
|
'🙁',
|
|
|
|
'☹️',
|
|
|
|
'😣',
|
|
|
|
'😖',
|
|
|
|
'😫',
|
|
|
|
'😩',
|
|
|
|
'😢',
|
|
|
|
'😭',
|
|
|
|
'😤',
|
|
|
|
'😠',
|
|
|
|
'😡',
|
|
|
|
'🤬',
|
|
|
|
'🤯',
|
|
|
|
'😳',
|
|
|
|
'😱',
|
|
|
|
'😨',
|
|
|
|
'😰',
|
|
|
|
'😥',
|
|
|
|
'😓',
|
|
|
|
'🤗',
|
|
|
|
'🤔',
|
|
|
|
'🤭',
|
|
|
|
'🤫',
|
|
|
|
'🤥',
|
|
|
|
'😶',
|
|
|
|
'😐',
|
|
|
|
'😑',
|
|
|
|
'😬',
|
|
|
|
'🙄',
|
|
|
|
'😯',
|
|
|
|
'😦',
|
|
|
|
'😧',
|
|
|
|
'😮',
|
|
|
|
'😲',
|
|
|
|
'😴',
|
|
|
|
'🤤',
|
|
|
|
'😪',
|
|
|
|
'😵',
|
|
|
|
'🤐',
|
|
|
|
'🤢',
|
|
|
|
'🤮',
|
|
|
|
'🤧',
|
|
|
|
'😷',
|
|
|
|
'🤒',
|
|
|
|
'🤕',
|
|
|
|
'🤑',
|
|
|
|
'🤠'
|
|
|
|
]
|
|
|
|
|
|
|
|
export default class EmojiModule implements IModule {
|
|
|
|
public install = (ai: 藍) => { }
|
|
|
|
|
|
|
|
public onMention = (msg: MessageLike) => {
|
|
|
|
if (msg.text && msg.text.indexOf('絵文字') > -1) {
|
|
|
|
const hand = hands[Math.floor(Math.random() * hands.length)];
|
|
|
|
const face = faces[Math.floor(Math.random() * faces.length)];
|
|
|
|
const emoji = Array.isArray(hand) ? hand[0] + face + hand[1] : hand + face + hand;
|
|
|
|
msg.reply(serifs.EMOJI_SUGGEST.replace('$', emoji));
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|