badjoin.blogg.se

Slack reminder bot
Slack reminder bot






map through the array of functions to schedule messagesĪwait fn() // call function to get returned Promise Your scripts section should now look like below: "scripts": *!`, In the package.json file, we’ll add a new script to run our server using nodemon.

slack reminder bot

Your bot token should start with the letters xoxb. env file in your root directory and add the following line in your. To securely use our Bot OAuth token in our application, we will be using the dotenv library that we have installed. To install these libraries, run the command: Dotenv – A Node.js library to keep our environment variables secure.

slack reminder bot

– Slack’s latest APIs allowing us to work with Slack apps.Nodemon – automatically restarts our server when we make changes to our code.Next, we’ll need to install a couple of packages to help us with our development process.You can edit the generated package.json file if you wish. Initialize a new Node.js project using npm init -y.Create a new directory and navigate into it from the terminal mkdir aeeiee-bot & cd aeeiee-bot.To run your ngrok server, run the command. Make sure your ngrok server is running on port 3000. Now, it’s time for the magic you’ve been waiting for! Time to make our bot do things! Now, we can write the code! Initial setup

slack reminder bot

Head to Features > OAuth and Permissions > Bot User OAuth token to obtain your token. We’ll need an access token to connect to our bot. Make sure to append /slack/events to your public URL from ngrok. For this example, we will be creating a slack command called birthdaylist.Ĭopy and paste either of the HTTP or HTTPS forwarding addresses from ngrok to the Request URL section. Once you have ngrok setup, navigate to Basic Information > Add features and functionality > Slack commands.








Slack reminder bot