llimllib / limbo

A simple, clean, easy to modify Slack chatbot
MIT License
402 stars 160 forks source link

Make !gif plugin use attachments #134

Closed StewPoll closed 6 years ago

StewPoll commented 6 years ago

I was looking at how you can format attachments this morning and had a lovely idea for the gif plugin.

Instead of just replying with the URL, we can send a proper attachment.

We'll need to send a message as referenced in #108 and we can structure the message like the following:

{
    "attachments": [
        {
            "title": searchterm,
            "title_link": gifs[0],
            "image_url": gifs[0]
        }
    ]
}

This would happen around here: https://github.com/llimllib/limbo/blob/0a73e64388bb69b34810c6e945869c941d76ad51/limbo/plugins/gif.py#L29

Instead of just returning right away, we'd build the dict and use server.slack.post_message there.

StewPoll commented 6 years ago

I've started this over at https://github.com/StewPoll/limbo/commit/75287ba3dac53beb89989032f888ccf5e85f27d4 but it's not quite working... fun

llimllib commented 6 years ago

I took a whack at this in #138, let me know what you think

llimllib commented 6 years ago

closed by #138