Creating a slack bot


#1

I’m in a slack group and one of the things we always talk about is music, especially with what new releases are out. For the first couple years it was very informal with people saying what is out but different people had different recommendations. This year I decided to make an Airtable database that we could all add new albums we thought the group may be interested in. Its become a highly used item and in my road map for wanting to use this is eventually create a bot in Slack that every Friday sends out a post with all the albums being released that day.

Anyone have any experience implementing something like this or could point me in the right direction on how to set up this system/automation?


#2

What programming languages do you know and do you have a server?

If the above sounds scary, it’s not! But you can do all of this with a paid Zapier account. The steps would be:

  • Schedule: Friday, at whatever time you want)
  • AirTable - Find Record: Filter for the records releasing today, you could even do the filtering and create a view in AirTable and just grab those
  • Slack: Send Channel Message

#3

I’ll look into Zapier but always shied away from it because I thought it was a paid platform.

I know some very basic python as I’ve started teaching myself some of it when I get the chance here or there. Additionally I don’t have a server but I have a raspberry pi that does nothing but sit in a desk drawer right now that I’d use if I needed one.

Edit: I’d also like to add I wouldn’t mind using this as that ‘project to start learning a language’ as I tend to not know much on how to implement what I’m learning yet.


#4

If you do want to do it in Python there are plenty of good starting points out there.

E.g.


#5

Looked into Zapier and it seems the only action I can do is based off of when a new record is made.

Also I wonder if I should do this in javascript (node.js to be exact) as there is official documentation for Airtable’s api?


#6

You would need a paid Zapier account for the suggestion I made above - because it’s more than just a trigger and an action.


#7

Ok. I’m trying it out now.


#8

In general, for APIs that are used by a lot of people, you can find some API wrapper for your language. For example, instead of learning JavaScript, you could probably just use this Python wrapper library, since you said you know some Python:


#9

Interesting. I’ll try that out.


#10

So I tried getting this to work and I feel like I’m messing something up as it won’t actually pull the records from today.

Below is how I set up the zap along with how the air table is set up.




I tried doing a formula search of today() along with other search formulas but that would just pull a single record from the database if at all, it being a release on 4/5/2019.

I’ve added the only record zapier will ever pull.