PKL is a bot for guessing package delivery.
Replace the placeholder in .env
file, namely the BOT_TOKEN
, SERVER_ID
,POSTGRES_USERNAME
, POSTGRES_JDBC_URL
and POSTGRES_PASSWORD
. As this is not a global bot (for now?) and we haven't really configure it to have different database for different servers, then the settings should really be personalised for each server that is going to use the bot, hence, different database as well.
Afterwards, just run up Main.kt
and the bot will be good to go.
Assuming you are using the docker compose file configs for postgres you can use the following command to run the migration
./gradlew flywayMigrate -Dflyway.url=jdbc:postgresql://127.0.0.1:666/PKL -Dflyway.user=mypreciousadmin -Dflyway.password=localtestingonlypassword -Dflyway.locations=filesystem:migrations
Note: Any time-related parameters are equipped with Natural Language date/time parser. While it is possible to just go with "18:00" as input, the bot would prefer a much verbose input. Here are some examples:
List of available commands goes below.
/paketliga
Create a PKL game, with parameters:
startwindow
- Start window of the delivery timeclosewindow
- Closing window of the delivery timeguessesclose (Optional)
- Guessing deadline for guessers. If none provided it will give a default value of an hour from current time. Or if window begins before then, five minutes before window startgamename (optional)
- Game name for the created game./findgames
Find active game(s), with parameters:
gamecreator (optional)
- The creator of the gamegameid (optional)
- ID of the gamegamename (optional)
- Name of the gameLeaving all the parameters empty will resulted in the bot listing all active games.
/guessgame
Guess an active game, with parameters:
gameid
- ID of the gameguesstime
- Guessed delivery timeGuessing a game twice with same game from a same user will resulted in updated guess instead of a new one. Guessing a game with guess time outside delivery window will resulted in failed command.
/findguess
Find guess(es) from game(s), with parameters:
guessid (optional)
- ID of the guessgameid (optional)
- ID of the gameLeaving all the parameters empty will resulted in empty response (for now)
/updategame
Update an active game, with parameters:
gameid
- ID of the gamestartwindow (optional)
- Start window of the delivery timeclosewindow (optional)
- Closing window of the delivery timeguessesclose (optional)
- Guessing deadline for guessersLeaving all optional parameters empty will resulted in no games to be updated.
Updating a game will resulted in all guessers to be notified (if any) to update their guesses.
/endgame
End an active game, with parameters:
gameid
- ID of the gamedeliverytime
- Actual delivery time for the gameEnding a game with delivery time outside the window will resulted in failed command. Ending a game will notify the winning guessers.
/leaderboard
Show leaderboard sorted by total points descending, with parameters:
username (optional)
- Username of the userLeaving the parameter empty will resulted in all (played) users to be shown. The fields shown are: played, win, lost, and total points.
Please open an Issue / PR, and we'll address it soon.
To Chris, who did the hard bits To Mike, who bitched this into existence