DEV Community

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

Posted on

3 1

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.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay