diff options
author | anekos | 2013-06-03 21:58:34 +0900 |
---|---|---|
committer | anekos | 2013-06-03 21:58:34 +0900 |
commit | 2997df782d42308a279ffb5a9f151795e1952e76 (patch) | |
tree | a8ac61455f89613625c772c569217f1f98f07561 /twittperator | |
parent | 3143dd280af6716562fc5a7b333cb5c022b9a8ca (diff) | |
download | vimperator-plugins-2997df782d42308a279ffb5a9f151795e1952e76.tar.bz2 |
ためしてない。
Diffstat (limited to 'twittperator')
-rw-r--r-- | twittperator/pong.tw | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/twittperator/pong.tw b/twittperator/pong.tw index 20ca5b5..c62ee49 100644 --- a/twittperator/pong.tw +++ b/twittperator/pong.tw @@ -13,7 +13,9 @@ function onMsg (msg, raw) { function negi (pattern, reply) { if (RegExp('^\\s*@' + screenName + '\\s+' + pattern + '\s*$').test(msg.text.trim())) { - plugins.twittperator.Twitter.say('@' + msg.user.screen_name + ' ' + reply, msg.id_str); + let replyText = reply instanceof Array ? reply[parseInt(Math.random() * reply.length, 10)] + : reply; + plugins.twittperator.Twitter.say('@' + msg.user.screen_name + ' ' + replyText, msg.id_str); return true; } } @@ -29,7 +31,7 @@ negi('pang', 'bang') || negi('bang', '( \u25D5 \u203F\u203F \u25D5 )') || negi('\u30C6\u30A3\u30ED', '\u30D5\u30A3\u30CA\u30FC\u30EC') || - negi('ニンジャ', 'コマンドー!') || + negi('ニンジャ', ['コマンドー!', 'チョーカン', 'トノサマ']) || negi('ねこなめりんちょくらぶ', 'ざりっ…ざりっ…') || negi('いつやるか?', '今でしょ!') || true; |