2015-08-28 19:58:22 +02:00
|
|
|
# Description:
|
|
|
|
# makes dank maymays
|
|
|
|
#
|
|
|
|
# Commands:
|
2015-09-26 17:26:09 +02:00
|
|
|
# hubot meme <template>,<upper title>,<lower title> - genera un meme
|
2015-08-28 19:58:22 +02:00
|
|
|
#
|
|
|
|
# Configuration:
|
|
|
|
# None
|
|
|
|
#
|
|
|
|
# Author:
|
|
|
|
# Enrico Fasoli (fazo96)
|
|
|
|
|
|
|
|
module.exports = (robot) ->
|
2015-09-26 17:26:39 +02:00
|
|
|
escape = (str) -> (str.replace /\ /g, '_').replace /-/g, '--'
|
|
|
|
|
2015-08-28 19:58:22 +02:00
|
|
|
robot.respond /meme (.+)/i, (res) ->
|
2015-09-26 17:26:39 +02:00
|
|
|
text = res.match[1]
|
2015-09-26 18:14:55 +02:00
|
|
|
if(text.split(',').length != 3)
|
|
|
|
res.send 'richiesta malformata: prova a chiedermi "asjon help meme" per sapere sapere come funziona il comando'
|
|
|
|
else
|
|
|
|
meme = (escape i.trim() for i in text.split ',').join '/'
|
|
|
|
url = 'http://memegen.link/' + meme + '.jpg'
|
|
|
|
res.send url
|