From a71c4f84f74ded4ae6a248b880b15dedd628234f Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 25 Feb 2017 18:51:27 +0100 Subject: [PATCH] small fixes --- scripts/misc.coffee | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/misc.coffee b/scripts/misc.coffee index 7741f0e..426ac3e 100644 --- a/scripts/misc.coffee +++ b/scripts/misc.coffee @@ -37,13 +37,12 @@ module.exports = (robot) -> thank = ['prego :)', "non c'è di che", 'faccio solo il mio lavoro', 'no problemo amigo', 'non fate complimenti ;)'] - sender = (res) -> - res.message.user.name.replace /_/g, ' ' + sender = (res) -> res.message.user.name welcome = (res) -> current = robot.brain.get 'ringraziato' robot.brain.set 'ringraziato', (current or 0) + 1 - res.send res.random thank + res.send res.random thank # thank asjon robot.hear /(?:grazie|bravo) (?:asjon|assa|assion(?:i|e))/i, welcome @@ -78,7 +77,7 @@ module.exports = (robot) -> # memes robot.respond /teq/i, (res) -> - res.send 'http://i3.kym-cdn.com/photos/images/newsfeed/000/353/279/e31.jpg' + res.send 'http://i3.kym-cdn.com/photos/images/newsfeed/000/353/279/e31.jpg' # other robot.respond /saluta (.+)$/i, (res) -> @@ -112,10 +111,9 @@ module.exports = (robot) -> res.send "sto parlando in #{res.message.room}, #{sender res}" robot.respond /ti amo/i, (res) -> - res.send 'anche io ti amo ' + sender res + res.send "anche io ti amo #{sender res}" robot.respond /ti odio/i, (res) -> - res.message.user.name = "Michele_Guerini_Rocco" res.send "ma cosa ti ho fatto di male #{sender res}? :(" robot.hear /(?:ehi|ciao|we|(?:bella(?: li)?)) (?:asjon|assa|assion(?:i|e))/i, (res) -> @@ -123,5 +121,8 @@ module.exports = (robot) -> 'dimmi', 'weeee', 'ehilà'] res.send "#{res.random greet} #{sender res}" - robot.respond /(ci sei)?\?/i, (res) -> - res.send res.random confirm + robot.respond /ci sei\?/i, (res) -> + res.send res.random confirm + + robot.hear /assa\?/, (res) -> + res.send res.random confirm