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 {
|
2018-08-12 14:03:00 +00:00
|
|
|
public name = 'emoji';
|
|
|
|
|
2018-08-11 06:53:49 +00:00
|
|
|
public install = (ai: 藍) => { }
|
|
|
|
|
|
|
|
public onMention = (msg: MessageLike) => {
|
2018-08-12 14:03:00 +00:00
|
|
|
if (msg.text && (msg.text.includes('絵文字') || msg.text.includes('emoji'))) {
|
2018-08-11 06:53:49 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|