Want to save yourself hours of time in boring admin tasks so you can concentrate on your real job?
Did you know you can use Slack as a command hub from which to control external services and systems?
You can use this powerful functionality for a wide range of things, from initiating an action in your project management system to kicking off an automated email campaign.
This course specifically will teach you how to create a custom slash command for Slack.
For example, you can setup a slash command that looks like
/bill 2.8 fixed jumpy header
that will automatically add that billed time (2.8 hours) with that task description (fixed jumpy header) against a client in your accountancy system. Slack sends the text entered together with the channel name it was sent from, so your script could match the channel name to your client's name in your accountancy package.
Super simple. Super clean. Super powerful.
The course is made up of a series of step-by-step screencasts of the course creator creating a slash command. We'll start from scratch to give you a very clear understanding of the development process and workflow for creating a custom slash command.
There is about an hour's worth of video content broken up into 14 discrete sections, making it very easy to complete the course at your own pace.
What We'll Build Exactly
We'll create a weather slash command.
This will allow someone to type something like /weather Cape Town which will display the weather for that city within Slack. This is a simple script, but will give you the basic framework on how to have a slash command call a server that calls an external service, perform any action and return some data to Slack.
An Overview of the Workflow We Will Build:
Skills You'll Learn
I look forward to helping you automate a lot of those repetitive tasks you normally perform in your business!
Note: This course is not created by, affiliated with, or supported by Slack Technologies, Inc.
A brief overview of Slack, an introduction to custom slash commands, how custom slash commands can help save you time by automating tasks (such as using the Trello or Freshbooks API), and what we will be building in this course.
My development environment:
We will create an account with http://openweathermap.org/ to get our API key.
Starting to code by adding in a few comments to state what we intend on doing. We will use ES6. In this video we test to make sure that Node.js can run our code.
Here we use axios (https://github.com/mzabriskie/axios) to actually perform our GET request to OpenWeatherMap to return some data.
Here we setup an Express server so that our city to search on can be passed through the URL.
Passing the GET request parameter that Express receives (the city) to axios.
So we can now call our Express server with /weather?text=Paris and get that to actually return weather data for that city.
An introduction to the Message Builder in Slack (https://api.slack.com/docs/formatting/builder). This video we work out the JSON that Slack requires that matches how we want our weather report to be rendered in Slack.
In this video we integrate the JSON structure we worked out from the previous video, into our script. So that our Express server returns that exact JSON object populated with the data we receive from OpenWeatherMap.
Here we package our script into a package.json file. Specifically we specify our dependencies in this file.
Here we setup a Droplet on DigitalOcean with Node.js, secure copy (scp) our files to our server, and install our script dependencies.
Here we configure our Slack account with our new slash command.
Congrats on finishing this course! The link to the source code is below. Please fork it and create your own slash command. Looking forward to seeing what you create!
I've been working in IT for about 15 years now!! Crazy to think how that time has flown. My passion now-a-days is frontend development using React and Redux.
Generally I love automating the processes people don't love, to give them the space to do what they do love to do. I also love taking new ideas and making them a digital reality!!