Progression: Enhancing a Slack Bot to Announce Sign-Ups
TD
Posted on December 4, 2022
It's time to let readers know about my progress so far with my implementation to make the Telescope Slack Bot announce when a new user registers.
I was in contact with Josue via Slack for guidance.
The Progress
Sending Initial Test Message
After getting collaborator access to the Telescope bot, to make sure that the bot works, I sent a test message to the #telecope-bot channel using the Postman client.
At this point, I was sure I could move on to the next step and try sending a message to my account from the Telescope front end.
Sending Test Messages to my Account (front-end)
The initial Javascript function publishSignupMessage
I wrote gets invoked each time a user successfully goes through the sign-up process in the development environment.
The result:
Sending Test Messages to my Account (back-end)
I revised my code to use Slack Bolt client, which I added to the sso
service directory structure. Also, publishSignupMessage
is invoked from one of the middleware
functions. Now, I can receive sign-up notifications whenever I create a test account.
The Problem
I am having a problem where even though I have all the environment variables in the right env
files, and I still get the following error:
throw new Error(`Missing SLACK_BOT_TOKEN env variable`);
^
Error: Missing SLACK_BOT_TOKEN env variable
at createSlackApp (/app/src/slack-bolt-client.js:9:11)
at publishSignUpMessage (/app/src/slack-bolt-client.js:61:15)
at /app/src/middleware.js:154:11
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I wonder if it has something to do with Docker since the project runs on it. If so, I need to research it as I have no prior experience with Docker.
Posted on December 4, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.