Closed kanno41 closed 7 years ago
That's with @bot lost to
? That would be bad. I will fix it, unless you want to beat me by sending a PR? (and getting a free bot :))
Yep, that's correct. I'm afraid that I am completely unfamiliar with Ruby, however. Thanks for fixing it!
lost.rb seems to be the place where the logic needs to be corrected.
It could be your first PR into a Ruby project! I can patiently help you :)
Start by going through https://github.com/dblock/slack-gamebot/blob/master/CONTRIBUTING.md and writing a test that reproduces the problem in https://github.com/dblock/slack-gamebot/blob/master/spec/slack-gamebot/commands/lost_spec.rb
I want to add this condition to lost.rb, but rubocop complains extensively about it since it makes the function too long! Any ideas?
elsif !(teammates & opponents).empty?
client.say(channel: data.channel, text: 'You cannot lose to yourself!', gif: 'loser')
logger.info "Cannot lose to yourself: #{client.owner} - #{match}"
Run rubocop -a ; rubocop --auto-gen-config
and don't worry about it.
A player can lose to themselves, counting for themselves a win and a loss. The gamebot should prevent losing to yourself.