pinky-ponky is a ping pong bot for Slack
written in Scala (uses the slack-scala-client library)
It keeps track of leaderboards, and can help you organise tournaments! With minor modifications it can also be used for other 2 player games.
Clone the repo, and create a file src/main/resources/credentials.txt
and put in it:
- 1st line: slack token
- 2nd line: administrator name
- 3rd line: channel-name
eg.
aaaa-543265645634-aa4254fsdg34tgsg4t32gfdg
the.boss
games-channel
To get the slack token, go to Apps & Integrations
on the slack menu, then Manage
(top right in Slack's website), then choose Custom Integrations
on the sidebar, then Bots
, and finally click Add configuration
.
If you haven't already, install sbt. Then In a terminal navigate to the root of the project and type
sbt run
Type help
in a slack channel/private IM with the bot and you 'll get a reply with the following message:
Your opponent will receive the following message:
Then you can reply yes
or no
, and you 'll both get a confirmation message:
To see your personal statistics, type stats me
(or to see someone else's statistics type stats @user.name
)
Tournaments work for any number of players: The bot will create at most 8 groups, and will fill them in with as many players as required.
In group stage, everyone plays with everyone else in the group once.
Match making is seeded for the best 8 players: The best to player (according to the leaderboards) will only meet the second best in the final, the best 4 in the semi-finals etc. The rest of the players in each group are selected in random.
The bot will notify daily for upcoming matches.
The administrator of the bot, declared in credentials.txt
, can issue some additional commands.
See Cmd.scala
exit
: To stop the botreload
: To reload thegames.txt
,pending.txt
andtournament.txt
, which are the databases for games, pending results and tournaments (e.g. if you do a manual edit)id @user.name
: To get the slack id of a playermessage Your message goes here
: To send a message to the slack channel declared incredentials.txt
as the slack bot.result @player1 @player2 2 0
: Verify a pending result (see pending results by typingpending
).deletepending @player
: If player has not confirmed a result yet, you can delete the last score reported by their opponent like so.
new tournament
: Delete an existing tournament (if it exists) and start a new one. Tournament is now open for registration.start
: Start the tournament, no more registrations allowedstop
: Stop and delete a tournament.register @user1 @user2 @user3
: Register players for the tournament (they can always register themselves by typingregister
vst @user1 @user2 2 0
: Report a tournament result that will not be taken into account in the leaderboards.delete @user1 @user2
: Delete a tournament result between user1 and user2extend time_in_days
: Extend the deadline for all tournament matches - can also be negative (e.g. to terminate a game that will never happen early)extend time_in_days @user1
: Extend the deadline for all tournament matches of user1extend time_in_days @user1 @user2
: Extend the deadline for the tournament match between user1 and user2