Progression: Enhancing a Slack Bot to Announce Sign-Ups

tdaw

TD

Posted on December 4, 2022

Progression: Enhancing a Slack Bot to Announce Sign-Ups

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.

The result:
test message 1

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:

test message 2

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)
Enter fullscreen mode Exit fullscreen mode

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.

💖 💪 🙅 🚩
tdaw
TD

Posted on December 4, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

OSD600 - Lab 8
opensource OSD600 - Lab 8

November 12, 2021