This is a Slack bot that manages a leaderboard for games played between users in a Slack channel. Users can report game results, revert results within 24 hours, and view the leaderboard.
- Report game results (win/loss) between users.
- Revert game results within 24 hours.
- Display the current leaderboard.
- Points are calculated based on the score difference between players.
-
Clone the repository:
git clone https://github.com/yourusername/standings.git cd standings
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your Slack app:
- Create a new Slack app at https://api.slack.com/apps.
- Add the following bot token scopes:
commands
,chat:write
,conversations.members
. - Install the app to your workspace and get the bot token and signing secret.
-
Set up environment variables:
export SLACK_APP_TOKEN='your-slack-app-token' export SLACK_BOT_TOKEN='your-slack-bot-token' export SLACK_SIGNING_SECRET='your-slack-signing-secret' export SLACK_CHANNEL_ID='your-slack-channel-id' export PORT=3000
-
Run the bot:
python app.py
/report win @opponent
: Report a win against an opponent./report loss @opponent
: Report a loss against an opponent./revert result @opponent
: Revert the result of a game against an opponent within 24 hours./leaderboard
: Display the current leaderboard.
-
Report a win:
/report win @opponent
-
Report a loss:
/report loss @opponent
-
Revert a result:
/revert result @opponent
-
Show the leaderboard:
/leaderboard
This project is licensed under the MIT License.