Building a Serverless Acronym Bot on GCP using Cloud Functions


The acronyms I’m using for this tutorial are from here.

  • A 12-month free trial with $300 credit to use with any GCP services.
  • Always Free, which provides limited access to many common GCP resources, free of charge.

Installing the bot

After signing into Slack, you’ll need to create a new app and give it a name and workspace. This is assuming you have the proper admin permissions and a slack workspace to do this.

Creating Function

After jumping over to Google Cloud Platform, you’ll need to navigate to Cloud Functions by clicking the navigation (top-left corner) and clicking Cloud Functions.

gcloud components update
  • config.json — where Slack verification token is stored
  • data.json — where list of acronym dictionaries are stored
  • — the file that contains the cloud functions logic
cd /tmp/
mkdir slackbot
cd slackbot
# source code here
vi config.json
# copy/paste the json from the github
# You'll need to edit this file and add the verification token from # earlier
vi data.json
# copy/paste as is from the github
vi main.oy
# copy/paste as is from the github
# create the cloud function
gcloud functions deploy acronym_bot --runtime python37 --trigger-http


I created a new channel and invited the bot into the channel. Next I took a sec to… well you know…



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store