1/ I have been meaning to build a Slack bot for a while and have done several proofs-of-concept in the bast. But every single time I have failed to actually ship it just because it requires a managed back-end and that just adds too much effort for a simple side-project at work.
2/ 📚 Introducing — The Dictionary Bot
The idea is simple. Look up a list of acronyms and return what it stands for. For example
3/ At a high level, I need the following for the bot to work:
- A Slack App (with Slash commands enabled)
- A URL that’s called whenever the Slash command is triggered
- Some kind of a Database to hold the Acronym definitions
- Ability to respond to the Slash Command
4/ Implementation - Backend with Tray
Tray.io is essentially built around workflows (think of it as a function) that can be called via various “triggers”. In my case a Slash command from Slack.
5/ To connect the workflow to the Slash command, it was just a matter of obtaining the unique URL for my Dictionary Bot workflow in Tray.io and providing it in the settings on my Slack app.
6/ Once connected and authenticated (which was done by providing Tray.io with a ‘signing secret’ from Slack), I was already able to start invoking the (/define) command from Slack and see the Tray workflow getting triggered.
7/ Airtable as the DB
The next step was to identify where to store my data so that it can be easily queried from the Tray.io. Think of Airtable as a glorious G Sheet that allows you to query your data over an out-of-the-box API.
It’s hard to believe, I know.
8/ With the data now available, all I had to do was create authentication for my Airtable account (which was trivial). The connector very conveniently provides the ability to filter your data by a formula which in my case was simply:
9/ Pretty much at this point, I had the output from the table that I wanted and was ready to craft a response to be sent back to Slack.
10/ Turns out, each Slash command request comes with a unique response_url that you can use to send a response and it’s sent to the same channel where the request originated — pretty convenient.
11/ And voila, the Slack bot was ready to be tested end-to-end and I did not even have to write a single line of code! 🎉
12/ It was quite enjoyable to build with @tray and @airtable and take my idea from inception to production within a matter of hours!!
What do you think? Thoughts? Questions?
• • •
Missing some Tweet in this thread? You can try to
force a refresh
I always knew that @NotionHQ is really powerful but I haven’t really been able to leverage it in the past.
Over the holidays, I completely revamped my personal productivity and life organization system.
All in Notion.
This is what I accomplished 👇
1/ Unification
With this revamp, I dropped several apps including Todoist, Journey, Goodreads, and Apple Notes. I also no longer need to maintain an analog bullet journal.
Everything is available in an easy to digest dashboard.
2/ Advanced Todo List
Think GTD + Bullet Journaling
Given I am in a permanent remote job and always at home, I am no longer working typical 9-5 hours. Work/Life is all integrated so I reflected this in the to-do list as well.