/slack-meme

Post memes to any of your Slack channels with a slash command.

Primary LanguagePython

slack-meme

Post memes to any of your Slack channels with a slash command.

Usage

/meme success; we have; a meme bot;

/meme templates shows you available templates:

Use your own image by passing its URL as the template:

/meme http://nicolewhite.github.io/static/me.jpg; hello; my name is nicole;

Setup

Slack API Token

Go to the Slack Web API page and scroll down to Authentication. If you haven't already, generate a token. This is your SLACK_API_TOKEN.

Incoming Webhook

Create a new Incoming Webhook. You can choose any channel; it doesn't matter. The channel will be overridden on each request with the channel from which the request originated. After creating, you'll see a Webhook URL field. This is your SLACK_WEBHOOK_URL.

Slash Command

Create a new Slash Command. Call it /meme. After creating, you'll see a Token field. This is your SLACK_SLASH_COMMAND_TOKEN. Keep this page open, as you'll need to configure the Slash Command further after deploying your Heroku App.

Deploy to Heroku

Deploy

Paste your SLACK_API_TOKEN, SLACK_WEBHOOK_URL, and SLACK_SLASH_COMMAND_TOKEN values into the appropriate config variables.

Click Deploy for Free. Once finished, the Name field will now be populated if you didn't choose a name upfront.

Finish Slash Command Config

Go back to your Slash Command configuration page, which you left open. Enter your app's URL, which is https://name-of-app.herokuapp.com, into the URL field. Replace name-of-app with the name of your app. Configure it to send a GET request to this URL. For example, here is my configuration page:

Save the Slash Command integration.

Credits

This uses memegen. Thanks memegen!