patsissons / hubot-giphy

hubot interface for giphy-api
MIT License
0 stars 3 forks source link

Mimic official giphy slack bot message formatting #10

Open patsissons opened 8 years ago

patsissons commented 8 years ago

image

we can use the customMessage function in the slack adapater: https://github.com/slackhq/hubot-slack/blob/596c4181ccb9f8423c15077e3df2e960cd9981eb/src/slack.coffee#L286

Some more info on it at these links:

patsissons commented 8 years ago

should probably allow this to be disabled via an env var.

patsissons commented 8 years ago

consider using thumb_url for the thumb_url

might need to crop it into a square.

source:

patsissons commented 8 years ago

test this format at https://api.slack.com/methods/chat.postMessage/test with: "attachments": [{"text": "<http://giphy.com/labs/|Giphy Labs> (123KB)", "image_url": "http://giphy.com/static/img/labs.gif"}]

visualize in the message builder

patsissons commented 8 years ago

we can confirm using the hubot-slack adapter by checking that robot.adapterName == 'slack'