๐ฃ A slack bot that gets images and post them
Sending a Slash Command like this:
Results in this:
This project is heavly inspired by hubot
's pugme
, for more info look here.
See the tutorial here.
Just send a /bomberman [breed/race] [quantity]
Slash command message on to the channel you've configured bomberman
, to receive the cute animals pictures ๐
Some examples:
/bomberman pug 2
/bomberman shiba 5
For now this project only works for dogs
, and the list of the accepted breeds is here.
This project is using Clojure
with http-kit
to create a HTTP server that runs on port 8080
.
It doesn't have a database, the only external thing it has is where it requests animal images.
There is only one possible route, which is POST /
, it accepts form-encoded
, data which is the format sent by Slack.
It reads from the request the Slack username
, the animal breed/race
and the quantity
of images.
If the quantity
is greater than 5
, it will send a message warning that there is a limit.
Get's the data on the https://dog.ceo API and sends the images to Slack.
After everything, it just sends a 200
status code to Slack, so it knows nothing is wrong.
Before everything, you will need to create a .env
file containing a line with the Slack URL bomberman
will use to actually send messages to a channel. On this repository there is a file called .env.example to show how this file should be. To actually get the Slack URL look at this part of the INSTALLATION.md
tutorial.
To run the project you will need either leiningen
or Docker
.
lein run
docker build -t bomberman .
docker run -it --rm -p 8080:8080 bomberman
You can check out the full license here
This project is licensed under the terms of the WTFPL license. You just DO WHAT THE FUCK YOU WANT TO.