

Thanks to them you can receive a call each time a message is sent to a channel. Outgoing webhooksįortunately, Slack provides another way of integrating with other services: webhooks. If only there was a way to react to actual messages instead of reading all the events. That is not how the code should look like. It works quite nicely, except for that awful endless loop.
Send giphy in slack install#
The bot should be more than happy to accept the invitation:įirst, you need to create a new virtualenv and install slackclient: Now that your bot is created, go ahead and invite it: From now on, I'm going to assume that your token is xoxo-123token. This will be required for your Python code to post messages to Slack channels. But the important part here is the token: It is possible (and advised!) to give it a nice name and a proper icon. Then, you can access your bot's settings. First, you need to pick a name for your bot: To create a new bot user, visit this link (of course, you have to be a full member of your team to do that). They are very similar to normal users, except they can be controlled using the API token.

The code will be simple and will do the one and only task that I mentioned: detect the phrase and respond with an image.

You don't have to know anything about Slack or Python frameworks, but basic Python skills are required (also a Heroku account or your own server would be helpful).
Send giphy in slack how to#
This post will show you how to integrate with Slack in two ways: using bot users and outgoing webhooks. I finally put together the information from different sources and decided to describe the process here. It was difficult for a person not familiar with Slack API and with bots in general to quickly create nothing more than a simple bot. But I found out that the learning resources are somewhat scattered around the Internet. It's job was to read messages and, if 'that would be great' was detected in the content, respond to the message with a picture of Bill Lumbergh from Office Space (yeah, I'm a funny guy).
