26 lines
659 B
CoffeeScript
26 lines
659 B
CoffeeScript
# Description:
|
|
# makes dank maymays
|
|
#
|
|
# Commands:
|
|
# hubot meme <template>,<upper title>,<lower title> - genera un meme
|
|
#
|
|
# Configuration:
|
|
# None
|
|
#
|
|
# Author:
|
|
# Enrico Fasoli (fazo96)
|
|
|
|
module.exports = (robot) ->
|
|
escape = (str) -> (str.replace /-/g, '--').replace /\ /g, '-'
|
|
|
|
usage = 'non si usa così: prova a chiedermi "asjon help meme" per
|
|
sapere sapere come funziona il comando'
|
|
|
|
robot.respond /meme (.+)/i, (res) ->
|
|
text = res.match[1]
|
|
return res.send usage if text.split(',').length != 3
|
|
|
|
meme = (escape i.trim() for i in text.split ',').join '/'
|
|
url = 'http://memegen.link/' + meme + '.jpg'
|
|
res.send url
|