Fix overzealous regex matching

This commit is contained in:
rnhmjoj 2015-05-04 18:12:22 +02:00
parent 5f41894e92
commit bf43addbcf

View File

@ -50,7 +50,7 @@ module.exports = (robot) ->
l.push a[i]+' volt'+(if a[i] is 1 then 'a' else 'e')+' '+i
res.send 'mi hanno chiamato '+l.join(', ')
# Altro
robot.respond /saluta (.+)/i, (res) ->
robot.respond /saluta (.+)$/i, (res) ->
res.send 'ciao ' + res.match[1]
robot.respond /spaca botilia/i, (res) ->
res.send 'AMAZO FAMILIA'
@ -68,12 +68,12 @@ module.exports = (robot) ->
res.send 'Ehm... praticamente...'
robot.hear /dilda/i, (res)->
res.send 'oplààààà'
robot.hear /^gg$/i, (res)->
res.send 'wp'
robot.hear /bravo (.+)/i, (res)->
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 /(.+) merda/i, (res)->
robot.hear /^(\w+) merda.?$/i, (res)->
if res.match[1].match /asjon|assa|assion|assioni/i
res.send res.random risata
else