BYB-BOT

## About

This discord bot is used in the reddit BYB league discord

## Commands

### !draft

Used to draft and manage a draft for backyard baseball leagues. It will follow the google sheet and notify coaches when they are up to pick. It will also fill in the draft board with the players drafted. If a player is already drafted, they will be "undraftable" to set a player back to undrafted use the !draft fix command.

* ~~*!draft AB ->* drafts a player based on the Character Code~~
* *!draft Pablo Sanchez* -> drafts a player based on name (it will find the closest match, so mispellings are okay.)
* *!draft undo* -> Undoes the most recent draft pick.
* *!draft set 20* -> sets the draft to pick 20 on the google sheet.
* *!draft reset* -> resets the entire draft.
* *!draft unlock* ->unlocks the draft.
* *!draft lock* -> locks the draft.
* ~~*!draft fix AB 'undrafted' 0* -> Sets player with character code AB to undrafted at pick 0.~~
* *!draft fix* syntax has changed to be `!draft fix [coach_code] [pick_num] [player_name]`
* ~~*!draft fix AB GG 23* -> Sets the player with character code AB to team GG at pick 23.~~
* `*!draft set auto*` -> will set the pick to the next open spot on the spreadsheet
* `*!draft* audit` -> will check for inconsistencies between the spreadsheet and database and list errors
* `*!draft sync*` -> will fix the errors found by draft audit

### !ratings

Used to show ratings of players or gather a list of the players that have a certain rating.

* *!ratings Achmed Khan*
* *!ratings Speed 6*

### !clankycoins

Keeps track of made up coins for anybody. Only awarded by people with a "Commissioner" role.

* !clankycoins @jibbodahibbo -> *displays jibbodahibbo's coin totals.*
* *!clankycoins add @Jlund24 300 ->* gives JLund24 300 coins.
* *!clankycoins remove @jibbodahibbo 50 ->* removes 50 coins from jibbodahibbo.
* !clankycoins ledger -> shows all the users who have clankycoins
* !clankycoins unbank 209348567293-> using the user id, it deletes a user from the ledger

### !schedules

A commissioner only command that can schedule league games for coaches.

* *!schedules lulu 3 @Monsters BB @Twins MB* -> This creates a lulu league week 3 matchup between the Monsters AT the Twins. The initials MB and BB are manager initials.
* *!schedules view lulu 3 ->* This shows the schedule for week 3 in lulu league, also shows which teams have confirmed results.
* *!schedules delete 43 - >* Each matchup will have an ID, you can see this with the view command. This is how you can delete a matchup if it was a mistake.
* *!schedules fixcoach jorge AA BB* -> Changes the coach in the jorge league from AA to BB. This may need to happen if a coaches drop out, or take over other teams.

### !standings

Shows the standings for a certain league (Uses the google sheets data)

### !result

Submit a result to the schedule. This is for coaches to submit matches privately. The bot will display both images when both coaches have submitted their results.

This command requires an image, league, coach initials, Game# and optionally a score

Commissioner can clear a result for players with !result clear [league] [game#] [Coach initials]

Commisioners can spy on a result to ensure that it was not a mistake submission !result spy [league] [coach id] [game number]

* *!result clear lulu 1 EX ->* clears any result submissions that are in lulu league, by coach EX in game 1.
* *!result spy s8 EX 1* -> this will dm the commissioner the image that was submitted by coach EX for game 1 in the LULU league.