Permalink
Browse files

Just for dz0ny!

  • Loading branch information...
1 parent 97914ae commit 22c225e17c8476a0057815c18783ee21d126b500 @CrazyLemon CrazyLemon committed Dec 23, 2016
Showing with 3 additions and 1 deletion.
  1. +2 −1 scripts/chatter.coffee
  2. +1 −0 test/chatter.coffee
View
@@ -124,7 +124,8 @@ module.exports = (bot) ->
url = "http://api.giphy.com/v1/gifs/search?q=#{encodeURI(match[1].replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s\s+/g, "+"))}&api_key=dc6zaTOxFJmzC"
bot.fetchJSON url.replace(/%20/g,'+'), (result) ->
if result.pagination.total_count > 0
- r.reply result.data[0].images.fixed_height.url
+ gif = "#{result.data[0].id}.gif"
+ r.reply " http://i.giphy.com/#{gif}"
else
r.reply "No gif available :("
View
@@ -17,6 +17,7 @@ describe 'chatter.coffee', ->
it 'test .gif get lucky', (done)->
bot.test ".gif get lucky", (msg)->
expect(msg).to.be.a('string')
+ console.log msg
done()
it 'test spread some love', (done)->

0 comments on commit 22c225e

Please sign in to comment.