Allow empty titles

This commit is contained in:
rnhmjoj 2015-09-28 18:56:28 +02:00
parent 1365d1d273
commit b4889339aa

View File

@ -23,6 +23,7 @@ module.exports = (robot) ->
sapere sapere come funziona il comando' sapere sapere come funziona il comando'
escape = (str) -> escape = (str) ->
return '_' unless str.length
str.replace( /-/g, '--') str.replace( /-/g, '--')
.replace(/\ /g, '-') .replace(/\ /g, '-')
.replace( /_/g, '__') .replace( /_/g, '__')
@ -42,10 +43,8 @@ module.exports = (robot) ->
names = template.aliases names = template.aliases
res.send (gen_meme names[0], title, names.join ', '), res.send (gen_meme names[0], title, names.join ', '),
if robot.adapterName is 'tg' then cb else '' if robot.adapterName is 'tg' then cb else ''
cb() if robot.adapterName isnt 'tg' cb() if robot.adapterName isnt 'tg'
robot.respond /meme (.+)/i, (res) -> robot.respond /meme (.+)/i, (res) ->
args = (i.trim() for i in res.match[1].split ',') args = (i.trim() for i in res.match[1].split ',')
return res.send usage if args.length != 3 return res.send usage if args.length != 3