summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Bot/Games/Game/Chess.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm
index f196a09..25f550e 100644
--- a/lib/Bot/Games/Game/Chess.pm
+++ b/lib/Bot/Games/Game/Chess.pm
@@ -56,6 +56,15 @@ around allow_new_player => sub {
return $self->$orig(@_);
};
+command resign => sub {
+ my $self = shift;
+ my ($dummy, $args) = @_;
+ $self->is_active(0);
+ return "$args->{player} resigns: "
+ . App::Nopaste::nopaste(text => $self->game->dump_pos,
+ nick => $args->{player})
+};
+
sub format_turn {
my $self = shift;
my ($turn) = @_;