diff --git a/scripts/misc.coffee b/scripts/misc.coffee index eb588ae..20a7a99 100644 --- a/scripts/misc.coffee +++ b/scripts/misc.coffee @@ -58,26 +58,11 @@ module.exports = (robot) -> res.send res.random(stato)+'. tu?' robot.respond /ridi/i, (res)-> res.send res.random risata - robot.hear /trogu/i, (res) -> - res.send 'comprate le prevendite da Trogu!!!' - robot.hear /sarte/i, (res) -> - res.send 'gesùùùù!!!' - robot.hear /migno/i, (res) -> - res.send 'il migno viene dal Molise... che non esiste... ahahah' - robot.hear /friz/i, (res)-> - res.send 'Ehm... praticamente...' - robot.hear /dilda/i, (res)-> - res.send 'oplààààà' robot.hear /gg( \w+)?\.?$/i, (res)-> res.send 'wp' unless res.match[1] is ' wp' robot.hear /^bravo (\w+).?$/i, (res)-> unless res.match[1].match /asjon|assa|assion|assioni(?:i|e)/i res.send res.random(complim)+' '+res.match[1] - robot.hear /^(\w+) merda.?$/i, (res)-> - if res.match[1].match /asjon|assa|assion|assioni/i - res.send res.random risata - else - res.send 'terra bruciata' robot.respond /dove sei/i, (res) -> robot.http('http://canihazip.com/s') diff --git a/scripts/scuola.coffee b/scripts/scuola.coffee index f0352c3..8862b94 100644 --- a/scripts/scuola.coffee +++ b/scripts/scuola.coffee @@ -29,21 +29,20 @@ fs.readFile './config/orario.json', (err, data) -> try orario = JSON.parse data catch e - console.log e orario = undefined fs.readFile './config/interrogazioni.json', (err, data) -> try interr = JSON.parse data catch e - console.log e interr = undefined - interr.sort (a,b) -> - if moment(a.day,'YYYY-MM-DD').isBefore(b.day,'day') - return -1 - if moment(a.day,'YYYY-MM-DD').isAfter(b.day,'day') - return 1 - return 0 + if interr?.sort?.call? + interr.sort (a,b) -> + if moment(a.day,'YYYY-MM-DD').isBefore(b.day,'day') + return -1 + if moment(a.day,'YYYY-MM-DD').isAfter(b.day,'day') + return 1 + return 0 module.exports = (robot) -> robot.respond /(?:che )?cosa abbiamo (?:per )?(domani|oggi)(?:\?)?/i, (res) ->