Helping our Slack community ask questions without fear of being judged
Once installed in your workspace, try it out by clicking the lightning bolt at the bottom left of the text box in Slack and clicking Ask question anonymously
in the list of shortcuts.
After asking your question, it will appear like this:
Project environment variables should first be defined in .env.sample
without real values for their data (that file is tracked by git). After cloning, make sure to duplicate .env.sample
as .env
and then fill in all required variables using the details provided in the section below.
This project is reliant on the installation of the following dependencies:
- Node (LTS) (v12.0+)
After downlodaing the dependencies above, install all NPM dependencies by running npm i
.
Before being able to run the app locally, you'll need to create a Slack app and configure it with the appropriate permissions:
- Create an app on the Slack API Site
- Using the sidebar, navigate to "OAuth & Permissions" and enable them
- Under 'Scopes' --> 'Bot Token Scopes' click
Add an OAuth Scope
and add the following scope:chat:write
chat:write.public
- Under 'Scopes' --> 'Bot Token Scopes' click
- Using the sidebar, navigate to the "App Home"
- Scroll to "_Your App's Presence in Slack" and click "Edit" next to "App Display Name" (using
Asking for a Friend
for the name andasking-for-a-friend
for the username is recommended) - We also recommend enabling "Always Show My Bot as Online"
- Finally, in the Show Tabs section, disable the Messages Tab
- Scroll to "_Your App's Presence in Slack" and click "Edit" next to "App Display Name" (using
- Using the sidebar, navigate to the "Basic Information", scroll down, copy the
Signing Secret
value and use it to replace theSLACK_SIGNING_SECRET
value in your.env
- Using the sidebar, navigate to the "Install App" and click "Reinstall App"
- Once finished, copy the
Bot User OAuth Access Token
value and use it to replace theSLACK_TOKEN
value in your.env
- Once finished, copy the
Once the above steps are finished, you'll need to connect your Slack app to your app running locally. Follow the steps in the Starting the App section below. After the app is running, you can use ngrok
to create a publicly accessible URL. Copy that URL and head back to your app's settings:
- Using the sidebar, navigate to "Interactivity & Shortcuts" and enable them
- For the
Request URL
field, use your app's URL and then append/slack/events
- Under Shortcuts, chose "Create New Shortcut", chose "Global", and use the following values:
- Name:
Ask question anonymously
- Short Description:
Posts an anonymous question in the current channel
- Callback ID:
postAnonymousQuestion
- Name:
- Click "Save Changes" at the bottom
- For the
- After clicking save, you should see a banner at the top of the page suggesting you reinstall the app; click
Reinstall
The best way to start the app and work on it is by using npm run dev
, which will start the app and then restart the app whenever a TypeScript file changes. After modifying a non-Typescript file, restart the app by typing rs
into the same terminal you ran npm run dev
from and then hitting return.
After the app starts, it will be accessible on localhost:3000
(unless the port was modified via .env
).
Interested in contributing to the project? Check out our Contributing Guidelines.