Slack bot to get user details.
Inspiration: https://github.com/jainishshah17/slack-weather-bot
Prerequisites
Getting started
- Checkout code:
git checkout https://github.com/budavariam/hackathon-slack-bot.git
- Install Npm dependencies:
cd hackathon-slack-bot
npm install-
Create Slack App
- Go to https://api.slack.com/apps
- Create New App: Name: Hackathon Development Slack Workspace: Choose your workspace
- Add preferred logo and description: "Get User info by searchstring."
- Copy
Signing Secretand store it in .env file. - Go to Basic Information -> Add Features and functionality -> add Slash commands
- Go to Features -> OAuth & Permissions -> OAuth Tokens & Redirect URLs.
Then copy
OAuth Access Tokenand store it in .env file.
-
Start app server
npm start
-
Install and run Ngrok
npm install -g ngrok ngrok http 3333 ## You will see output like following ngrok by @inconshreveable (Ctrl+C to quit) Session Status online Session Expires 7 hours, 59 minutes Version 2.3.40 Region Europe (eu) Web Interface http://127.0.0.1:4040 Forwarding http://c1219f73.ngrok.io -> http://localhost:3333 Forwarding https://c1219f73.ngrok.io -> http://localhost:3333 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
- Create Slash Command in Hackathon Slack App we created
-
Go to Features -> Slash Commands -> Click on Create New Command
- Provide following details for new slash command:
- Command:
/whois - Request URL:
https://c1219f73.ngrok.io/(Note:Use your ngrok generated HTTPS URL) - Short Description:
Get User info by searchstring. - Usage Hint:
[searchstring]
-
Go to slack and type
/whois skyto see the magic!
-
