DEV Community

Cover image for Progression: Enhancing a Slack Bot to Announce Sign-Ups
TD
TD

Posted on

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.

Top comments (2)

Collapse
 
gulyapulya profile image
Gulnur Baimukhambetova

Getting to the errors means progress. Stay strong! ✊🏼

Collapse
 
tdaw profile image
TD

Definitely. 😁💯 Thank you for your comment.