This commit is contained in:
Enrico Fasoli 2015-04-23 19:26:48 +02:00
parent a98e306829
commit 42a40a3c79
2 changed files with 12 additions and 6 deletions

View File

@ -36,10 +36,11 @@ cosaCePerIl = (day,res) ->
res.send 'aspetta che guardo l\'agenda per il '+day+' (potrei metterci fino a 3 minuti)' res.send 'aspetta che guardo l\'agenda per il '+day+' (potrei metterci fino a 3 minuti)'
downloadAgenda day, (data) -> downloadAgenda day, (data) ->
if data.length is 0 if data.length is 0
res.send "non c'è niente per doma :)" res.send "non c'è niente segnato sull'agenda per il "+day
else else
res.send "ecco cosa c'è per doma: "+data.join('; ') res.send "ecco cosa c'è per doma: "+data.join('; ')
module.exports = (robot) -> module.exports = (robot) ->
robot.hear "cosa c'è per domani?", (res) -> robot.hear "cosa c'è per domani?", (res) ->
cosaCePerIl moment().add(1, 'days').format('YYYY-MM-DD'), res cosaCePerIl moment().add(1, 'days').format('YYYY-MM-DD'), res
robot.hear /cosa c'è per il (\d+-\d+-\d+)/i, (res) ->
cosaCePerIl res.match[1], res

View File

@ -1,4 +1,7 @@
module.exports = (robot) -> module.exports = (robot) ->
grazie = (res) ->
robot.brain.set 'ringraziato', (robot.brain.get('ringraziato') or 0) + 1
res.send res.random ['prego :)', "non c'è di che"]
robot.hear /sniper/i, (res) -> robot.hear /sniper/i, (res) ->
res.send 'sniper???? sniper non morire' res.send 'sniper???? sniper non morire'
robot.hear /trogu/i, (res) -> robot.hear /trogu/i, (res) ->
@ -7,9 +10,11 @@ module.exports = (robot) ->
res.send 'ricordatevi che se mi chiamate chiedendo cosa c\'è per domani posso guardare io sull\'agenda!' res.send 'ricordatevi che se mi chiamate chiedendo cosa c\'è per domani posso guardare io sull\'agenda!'
robot.respond /spaca botilia/i, (res) -> robot.respond /spaca botilia/i, (res) ->
res.send 'AMAZO FAMILIA' res.send 'AMAZO FAMILIA'
robot.hear "grazie asjon", (res) -> robot.hear /grazie asjon/i, grazie
robot.brain.set 'ringraziato', (robot.brain.get('ringraziato') or 0) + 1 robot.respond /grazie/i, grazie
console.log robot.brain.get 'ringraziato'
res.send 'prego :)'
robot.respond /ringraziamenti/i, (res) -> robot.respond /ringraziamenti/i, (res) ->
res.send 'voi teneroni mi avete ringraziato ' + (robot.brain.get('ringraziato') or 0) + ' volte :)' res.send 'voi teneroni mi avete ringraziato ' + (robot.brain.get('ringraziato') or 0) + ' volte :)'
robot.respond /dove sei/i, (res) ->
robot.http('http://canihazip.com/s')
.get() (err, r, body) ->
res.send 'dovrei essere a ' + body