Chomps is a GroupMe bot written in Python which can log and track beer pong stats for multiple players, and create/update a Google sheet containing stats for all players. It was designed to be simple enough for someone several games deep to use it, while still providing enough functionality to make it a useful tool.
- Log game results
- Support multiple nicknames for players up to two words
- Provide a stat printout directly to GroupMe upon request
- Update a Google Sheet with relevant stats, such as win percent, average cups made per game, and most common partner
- Register new players directly from GroupMe
- Maintain a list of all logged games, which can be updated in case of misreported stats
- Run the command
pip install -r requirements.txt
to install required dependencies - Create a GroupMe bot. Set the callback url to the IP on which you plan to run the bot, with an arbitrary port.
- If you're planning on using the spreadsheet functionality, you'll need signed credentials from Google. (Note: A sample spreadsheet is located here). I recommend following the instructions for 'Signed Credentials' from pygsheets. Then rename your credentials to
client_secret.json
and place it in thedata/
folder. Next, runmake setup
and follow the prompts. I highly recommend adding an email address. After setting this up, add any formatting you'd like to the Stats sheet. A link to the spreadsheet should have been sent to your email. - Setup the config file and save it as
data/config.json
. There's an example in the data folder. - Run
make startup-daemon
to create a background process running the bot. - Finally, register some players using
!register <name>
and start playing!
Note: Whenever a name is required, any valid nickname will work.
<player1> (cups made) <player2> (cups made) beat <player3> (cups made) <player4> (cups made)
Alice (6) Bob (4) beat Eve (3) Chuck (4)
In addition to the Stats spreadsheet, Chomps can compile and format stats to be sent to the GroupMe.
!stats <player>
Input: !stats Alice
Output:
Player Name: Alice
Total Cups: 78
Win %: 28.57%
Most Common Partner: Bob
% Wins Carried: 12.50%
% Wins Was Carried: 0.00%
Cups/Game: 4.71
Times Trolled: 0
Total Beers Drank: 24.10
Total Win Count: 6
Total Game Count: 21
Nicknames allow for users to refer to a single player by multiple names. Nicknames are case insensitive, and unique across a playerbase. You can view a player's nicknames with the !nicknames <player>
command.
!add nickname <player> = <new nickname>
!add nickname Eve = Erin
The functions listed above are only a few of the features of Chomps. Sending the !help
command will output a printout of all available commands and their format.
This project is licensed under the MIT License
A special thanks to all of the following:
- pygsheets
- GroupMe
- University of Southern California's Beer Pong Club
In order of priority:
- Write a script to set up a GroupMe bot
- Write more unit tests
- Convert player stat into named tuple
- Implement functionality to archive stats, and reset all data (new seasons)