Building a ChatGPT Slackbot with Javascript
Vložit
- čas přidán 1. 07. 2024
- Join me as I build a ChatGPT Slackbot using the Slack Bolt Javascript Library!
All code can be found here: github.com/ChristianAlexander...
00:00 - Intro
00:37 - Hello World
1:10 - Wiring it up
1:54 - Feeding it some threads
3:13 - Improving the UX
3:54 - DEMO
4:07 - Summary - Věda a technologie
Is it possible to test from Postman?If yes can you tell us the step for it?
The Slack Bolt SDK exchanges secret values with and connects directly to Slack. I don't think there's a way to test this from Postman.
For more details, check out the Bolt docs: slack.dev/bolt-js/tutorial/getting-started
Hi. it is working, thank you so much. Initially I was struggling with 429 error, it resolved after I added credits. Need your guidance to implement Dell-E.
Hi, i tried implement ur amazing bot but slack is asking me to answer herokus request URL with a challenge, can you help me with it?
Thanks in advance.
Also really good work with the video, it was clean as water ur explanation, keep going.
Hi there! When I saw a similar error, I had to update the URL to be /slack/events (the /slack/events part is critical). The bolt framework should automatically handle the URL challenge.
Slack documents this step with their own bot here: slack.dev/bolt-js/deployments/heroku#deploy-the-app
@@CodeAndStuff Thanks for the fast reply.
Yeah, i tried, even got the CLI to check the url but the message i get still is
Your request URL responded with an HTTP error. Update your URL to receive a new request and challenge value.
:(
@@renatomeireles9596, that sounds frustrating-I hope this can help:
Make sure all of the environment variables from the readme are set properly. Beyond that, it might be worth looking at the logs from the Heroku dyno (devcenter.heroku.com/articles/logging#view-logs) to see if anything is erroring out.
Also, if you set `SLACK_APP_TOKEN`, it might be running in socket mode (api.slack.com/apis/connections/socket). This mode doesn't use webhooks and instead uses websockets to make the connection. Again, the heroku log should say if the app is started in socket mode.
@@CodeAndStuff Thanks Buddy, i found what i was doing wrong.
But now the app is crashing after i ask like 2 questions to the bot...
[INFO] socket-mode:SocketModeClient:0 Now connected to Slack
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Stopping process with SIGKILL
Process exited with status 137
State changed from starting to crashed
Do you know what could be?
Ah, there it is! The app is running in socket mode, which prevents it from responding to HTTP requests. Heroku runs health checks and determines the app is not alive.
To fix this, get rid of the `SLACK_APP_TOKEN` environment variable. That will cause the app to run in server mode, allowing Heroku and Slack to connect properly.