A Slack bot for peer-to-peer appreciation aligned with company values. This bot allows team members to recognize each other using a simple syntax, with point awarding, daily limits, a leaderboard, and redeemable rewards.
- Recognition via "@user +++ for ... #value" syntax (multi-user and usergroup aware)
- Point awards based on
+count with daily budget enforcement - Company values tagging with
#valueand a#generalfallback - Celebration GIFs for recognitions (PG-rated, fixed-height to avoid scrolling)
- App Home experience: stats, leaderboard, goodies store, admin settings
- Admin configuration commands for limits, values, labels, rewards, and GIF controls
- Reward redemption flow with modal or slash command
- Postgres-backed storage with optional token encryption at rest
- Zero-cost hosting compatibility
- Node.js (v14 or newer)
- npm or yarn
- A Slack workspace with admin rights
- Docker (optional, for local Postgres)
-
Clone this repository:
git clone https://github.com/yourusername/slack-appreciation-bot.git cd slack-appreciation-bot -
Install dependencies:
npm install
-
Create a
.envfile in the root directory with your Slack credentials:SLACK_CLIENT_ID=your-client-id SLACK_CLIENT_SECRET=your-client-secret SLACK_STATE_SECRET=your-random-state-secret SLACK_SIGNING_SECRET=your-signing-secret SLACK_SCOPES=chat:write,commands,users:read,usergroups:read,channels:read,im:read,mpim:read,groups:read,channels:history,groups:history,im:history,mpim:history GIPHY_API_KEY=your-giphy-api-key DATABASE_URL=postgres://appreciation:appreciation@localhost:5432/appreciation DATABASE_SSL=false SLACK_INSTALL_ENCRYPTION_KEY=your-random-32-byte-secret PORT=3000Token-based (single workspace) setup is also supported. If you prefer to skip OAuth, set:
SLACK_BOT_TOKEN=xoxb-your-bot-token SLACK_SIGNING_SECRET=your-signing-secret GIPHY_API_KEY=your-giphy-api-key DATABASE_URL=postgres://appreciation:appreciation@localhost:5432/appreciation DATABASE_SSL=false PORT=3000 -
Build the TypeScript code:
npm run build
-
Start the bot:
npm start
- Go to https://api.slack.com/apps and click "Create New App"
- Choose "From scratch" and provide a name for your app
- Under "Basic Information", note your Signing Secret
- Under "Socket Mode", enable it and create an App-Level Token with the
connections:writescope - Under "OAuth & Permissions":
- Add the following Bot Token Scopes:
app_mentions:readchannels:historychannels:readchat:writecommandsgroups:historyim:historyusers:readreactions:write
- Install the app to your workspace
- Note your Bot User OAuth Token
- Add the following Bot Token Scopes:
- Under "Event Subscriptions":
- Enable events
- Subscribe to bot events:
app_home_openedmessage.channelsmessage.groupsmessage.im
- Under "Slash Commands":
- Create the following commands:
/points/redeem
- Create the following commands:
- Under "App Home":
- Enable the Home Tab
Note: The bot only receives messages in channels it has been invited to. Use
/invite @your-bot-namein any channel where you want recognitions to work.
To recognize a team member, use the following syntax in any channel where the bot is present:
@username ++ helped me debug an issue #innovation
This awards the user 2 points for the "innovation" value. The number of + symbols determines the points awarded.
You can also recognize multiple users or groups in a single message:
@username1 @username2 +++ for great teamwork #teamwork
@developers ++ let's go #teamwork
- The first example awards 3 points to both
@username1and@username2for the "teamwork" value. - The second example awards 2 points to all members of the
@developersgroup for the "teamwork" value.
/points config daily_limit <n>- Set the daily point limit/points config add_value <value>- Add a company value/points config remove_value <value>- Remove a company value/points config label <label>- Set a custom name for points (e.g. "kutanacoins")/points config gif_enabled on|off- Enable or disable celebration GIFs/points config gif_min_points <n>- Set the minimum points required for a GIF/points reward add "Reward Name" <cost>- Add a redeemable reward/points reward remove "Reward Name"- Remove a reward/points reset @user- Reset a user's points to 0/points reset all- Reset all users' points to 0
/redeem "Reward Name"- Redeem a reward/redeem(without arguments) - Open the redemption modal
The App Home shows:
- A section selector dropdown with the following options:
- Home: Your stats, points by value, how to recognize, and how to redeem.
- Recognition Leaderboard: Top recognized team members this month.
- Goodies store: Browse and redeem configured rewards via buttons.
- Settings (admins only): View and modify app configuration directly (daily limit, company values, rewards catalog, GIF controls, reset points) through interactive controls.
When in Settings, admins see current configuration values and buttons to set daily limits, toggle GIFs, set GIF minimum points, add/remove values and rewards, or reset individual/all user points directly from the UI.
Data is stored in Postgres. For local development you can run a Postgres container:
npm run db:upTo stop it:
npm run db:downFor hosted databases that require SSL, set DATABASE_SSL=true. If you set SLACK_INSTALL_ENCRYPTION_KEY, bot tokens will be encrypted at rest before being stored.
This bot can be hosted on various free tier platforms:
- Heroku Free Dyno
- Glitch.com
- Replit
- Railway.app free tier
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Write tests for your changes
- Run the test suite to ensure functionality (
npm test) - Push to the branch (
git push origin feature/my-new-feature) - Create a new Pull Request
Run tests using:
npm testThis project is licensed under the MIT License - see the LICENSE file for details.