A Slack bot that helps team members recognize each other by giving kudos. When someone mentions a user with a "++" suffix (e.g., "@user ++"), the bot records the kudos. Users can view the top kudos recipients using the "/kudos" slash command.
- Track and manage kudos given to users in Slack workspaces
- Maintain a leaderboard of kudos recipients
- Support for multiple Slack workspaces
- Easy installation via OAuth 2.0 flow
go build -o kudosbotExport the following environment variables:
# Required configuration
export KUDOS_SLACK_CLIENT_ID='your_client_id'
export KUDOS_SLACK_CLIENT_SECRET='your_client_secret'
export KUDOS_SLACK_APP_TOKEN='xapp-...' # App-level token for Socket Mode
# Optional configuration
export KUDOS_SQLITE_FILENAME='kudos.db' # Default: kudos.db
export KUDOS_SERVER_PORT='8080' # Default: 8080
export KUDOS_BASE_URL='https://your-domain.com' # Default: http://localhost:8080
export KUDOS_DEBUG='true' # Enable debug mode with HTTPS self-signed certWhen running with KUDOS_DEBUG=true:
- The application automatically generates a self-signed certificate
- HTTPS is used instead of HTTP to meet Slack's OAuth requirements
- You must manually accept the self-signed certificate in your browser:
- Open the app URL (e.g., https://localhost:8080) in your browser
- Click 'Advanced' and then 'Proceed anyway' to accept the certificate
- Then try the Slack OAuth flow again
This is only required for local development. In production, you should run behind a reverse proxy that handles HTTPS termination.
The redirect URI is automatically set to $KUDOS_BASE_URL/oauth/callback unless overridden by:
export KUDOS_SLACK_REDIRECT_URI='https://your-domain.com/oauth/callback'./kudosbot- Go to Slack API and click "Create New App"
- Choose "From scratch" and give your app a name
- Select the workspace where you'll develop your app
- Under "Basic Information", customize your app's name, description, and icon
- Note your Client ID and Client Secret for your environment variables
- Go to "OAuth & Permissions" in the sidebar
- Under "Scopes" > "Bot Token Scopes", add the following permissions:
channels:historychannels:readchat:writecommandsgroups:historyim:historyusers:read
- Go to "Socket Mode" in the sidebar and enable it
- Generate an app-level token with the
connections:writescope:- In "Basic Information" > "App-Level Tokens" click "Generate Token and Scopes"
- Add the
connections:writescope - Give your token a name (e.g., "socket-mode")
- Copy the generated token (starts with
xapp-) and set it asKUDOS_SLACK_APP_TOKEN
- This token is used by your server for Socket Mode connections to Slack
- Go to "Slash Commands" in the sidebar
- Create a new command called
/kudos - Set the Request URL to your server's endpoint (during development, this can be a placeholder)
- Add a description: "View kudos leaderboard"
- Go to "Event Subscriptions" in the sidebar
- Enable events
- Subscribe to bot events:
message.channelsmessage.groupsmessage.im
- Go to "OAuth & Permissions" in the sidebar
- Add your Redirect URL (e.g.,
https://your-domain.com/oauth/callback) - Go to "Manage Distribution" in the sidebar
- Enable public distribution
- Fill out the required information:
- App description
- Application website
- Verification info for Slack's review
- Terms of service and privacy policy URLs
- Complete the Slack App Submission Checklist
- Submit your app for review by Slack
- Once approved, your app will be available in the Slack App Directory
- Deploy your application to a server with a public IP address
- Ensure your server is accessible via HTTPS
- Configure your environment variables with your Client ID, Client Secret, and Redirect URI
- Start your application
After your app is published:
- Users can install the app from the Slack App Directory or your landing page
- They'll click the "Install on Slack" button
- They'll authorize the permissions
- The bot will be added to their workspace
- They should add the bot to channels where they want to use it
After installation, you need to:
-
Invite the bot to channels where you want it to work:
- In Slack, go to the channel where you want to use Kudos
- Type
/invite @kudos-bot(replace with your actual bot name) - The bot needs to be in a channel to detect kudos mentions and respond to commands
-
Using the bot:
- To give kudos: mention a user followed by
++(e.g.,@user ++) - To view the kudos leaderboard: use the
/kudosslash command - By default, the leaderboard shows the top 5 users
- To give kudos: mention a user followed by
If you see an error like "The app is not in this channel" or "Cannot find app" when using commands, you need to invite the bot to the channel first.