Hello, I just created my bot on slack api website and added all the secrets to the .env file. Init npm and git there and download dotenv package to use those variables through process.env , Now let me read some docs and start to code!!!- 3minutes
FT didnt let me post so let me start some code
Now, i got to know that i need to add some scopes before my bot can be coded so i added like chat:write and commands.
I also installed @slack/bolt module. Looks like it is the main thing and i dont need to send api requests again and again
I installed the bot in hack-club, now i got the bot token and added it in env.
Imported App class from slack lib and made a new App which i put the env variales into.
the guide said that i had to create a function and execute the server for bot to run on
and created it and hosted on port 3000.
Now I had successfully run the server but now the bot needed to connect to me so we enabled a thing called socket mode and changed a code a little bit also added a app_token with 2 scopes.
ANd now i ran the code to see what happen.
Log in to leave a comment