Nicer syntax for the meme generator
This commit is contained in:
parent
5d668bec1f
commit
b77dd53523
@ -11,6 +11,10 @@
|
|||||||
# Enrico Fasoli (fazo96)
|
# Enrico Fasoli (fazo96)
|
||||||
|
|
||||||
module.exports = (robot) ->
|
module.exports = (robot) ->
|
||||||
|
escape = (str) -> (str.replace /\ /g, '_').replace /-/g, '--'
|
||||||
|
|
||||||
robot.respond /meme (.+)/i, (res) ->
|
robot.respond /meme (.+)/i, (res) ->
|
||||||
url = 'http://memegen.link/'+res.match[1]+'.jpg'
|
text = res.match[1]
|
||||||
|
meme = (escape i.trim() for i in text.split ',').join '/'
|
||||||
|
url = 'http://memegen.link/' + meme + '.jpg'
|
||||||
res.send url
|
res.send url
|
||||||
|
Loading…
Reference in New Issue
Block a user