dblock / slack-gamebot

Ping pong, chess, pool and other games bot for Slack.
MIT License
129 stars 103 forks source link

undo (pongbot loss) #198

Open jnewsum opened 2 years ago

jnewsum commented 2 years ago

It would be great if "pongbot undo" was added to the useable commands.

We have had an issue where sometimes people input "pongbot lost" and the win is logged to the wrong user because a challenge was not issues. Some users use "pongbot lost to @user" and others like to issue a challenge with "pongbot challenge @user" and complete it with "pongbot lost".

Right now, there is no way to undo the incorrectly logged wins. I can't even balance the score by issuing a win back to the other user because the elo wont balance out and the "pongbot matches" will be incorrect.

dblock commented 2 years ago

Undo is a good idea.

Can you please explain the sequence of calls where a user ends up losing to the wrong person, though? I think I'm missing something. Maybe we can fix that differently.

jnewsum commented 2 years ago

The issue is specifically the last entry Joel put into pongbot. Joel was not in a challenge at that time. He played a game and should have input "pongbot lost to @user". He did put in the wrong command, but pongbot shouldn't have given the win to @JD because they weren't in a challenge.

I copied the history relating to Joel that day, so you could see that he issued a challenge and completed it before he input "pongbot lost".

`Joel Farley 12:32 PM pongbot challenge @channel

playplayio_pingpong_fAPP 12:32 PM @Joel Farley challenged anyone to a match!

Joel Farley 2:07 PM plz?

Matthew Knowles 2:59 PM pongbot accept

playplayio_pingpong_fAPP 2:59 PM matthew.knowles accepted joel.farley's challenge.

David 3:57 PM pongbot challenge @Matttrimble

playplayio_pingpong_fAPP 3:57 PM @David challenged @Matttrimble to a match!

David 4:01 PM pongbot cancel

playplayio_pingpong_fAPP 4:01 PM David canceled a challenge against Trimble.

David 4:02 PM pongbot challenge @Jonathan

playplayio_pingpong_fAPP 4:02 PM jonathan.davis can't play. There's already a challenge between DJ and JD.

Jonathan 4:02 PM pongbot cancel

playplayio_pingpong_fAPP 4:02 PM JD canceled a challenge against DJ.

Jonathan 4:02 PM pongbot accept

playplayio_pingpong_fAPP 4:02 PM No challenge to accept!

David 4:02 PM pongbot challenge @Jonathan

playplayio_pingpong_fAPP 4:02 PM @David challenged @Jonathan to a match!

Jonathan 4:02 PM pongbot accept

playplayio_pingpong_fAPP 4:02 PM JD accepted David's challenge.

Matthew Knowles 4:06 PM pongbot lost

playplayio_pingpong_fAPP 4:06 PM Match has been recorded! joel.farley defeated matthew.knowles.

Jonathan 4:36 PM pongbot lost

playplayio_pingpong_fAPP 4:36 PM Match has been recorded! David defeated JD.

Joel Farley 5:13 PM pongbot lost

playplayio_pingpong_fAPP 5:13 PM Match scores have been updated! JD defeated joel.farley.``

jnewsum commented 2 years ago

I think "pongbot undo @user1 lost to @user2" would be a great command to add. If I had some free time, I would try to fork and add the feature myself.

Just to be clear, we are not upset that this has happened. I just thought this was a good opportunity to think about an undo feature.

dblock commented 2 years ago

I think "pongbot undo @user1 lost to @user2" would be a great command to add. If I had some free time, I would try to fork and add the feature myself.

Cool. If you want to do less work to start, try to reproduce the above sequence in a spec. Maybe there's a shorter one.

Just to be clear, we are not upset that this has happened. I just thought this was a good opportunity to think about an undo feature.

Haha, no stress and thank you! Only Joel should be upset since JD defeated him :)

jnewsum commented 2 years ago

Well, that is the issue. JD didn't defeat him. Joel meant to input a loss to Jake (me) but he forgot that a challenge was not issued. He should have input "pongbot lost to @jake" to log the loss correctly. The error is that the loss went to JD but there was not challenge, so "pongbot lost" should have been an invalid entry.

jnewsum commented 2 years ago

I try to avoid issuing challenges and mostly only use "pongbot lost to @user", but I will keep an eye out to see if the issue happens again.

dblock commented 2 years ago

Well, that is the issue. JD didn't defeat him.

I know, I was trying to be funny!