From b4889339aab08d6d1caacd861dcb6297be30801c Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 28 Sep 2015 18:56:28 +0200 Subject: [PATCH] Allow empty titles --- scripts/memes.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/memes.coffee b/scripts/memes.coffee index 8b4ebdb..63c863b 100644 --- a/scripts/memes.coffee +++ b/scripts/memes.coffee @@ -23,6 +23,7 @@ module.exports = (robot) -> sapere sapere come funziona il comando' escape = (str) -> + return '_' unless str.length str.replace( /-/g, '--') .replace(/\ /g, '-') .replace( /_/g, '__') @@ -42,10 +43,8 @@ module.exports = (robot) -> names = template.aliases res.send (gen_meme names[0], title, names.join ', '), if robot.adapterName is 'tg' then cb else '' - cb() if robot.adapterName isnt 'tg' - robot.respond /meme (.+)/i, (res) -> args = (i.trim() for i in res.match[1].split ',') return res.send usage if args.length != 3