diff --git a/scripts/doge.coffee b/scripts/doge.coffee index b4c1888..121cf24 100644 --- a/scripts/doge.coffee +++ b/scripts/doge.coffee @@ -36,8 +36,10 @@ module.exports = (robot) -> "http://dogr.io/#{escape text}.png?split=false" shiba = (res, words) -> - word = words.filter (x) -> x.length > 4 prefix = [ 'much', 'such', 'many', 'very'] + word = words.filter (x) -> + /^[a-zA-ZàèéìòùÀÈÉÌÒÙ\-_!&@#?]{4,}$/.test x + console.log word (res.random prefix) + ' ' + (res.random words) run_command = (command, callback) -> @@ -59,7 +61,7 @@ module.exports = (robot) -> callback ((match_all regex, lines.join '\n').map parse_line) robot.respond /doge(?: (\d+))?/, (res) -> - n = res.match[1] || 10 + n = res.match[1] || 20 get_history res.message.room, n, (history) -> words = concat (message.text.split ' ' for message in history) sample = (res.random ['wow', shiba res, words] for _ in [0..8])