From 80bc79cfbcc9e06f1c93390bf378111b5382233b Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 27 Nov 2024 16:51:02 -0800 Subject: [PATCH] Plugin/Wordle: always have last word/guess in `info` --- lib/PBot/Plugin/Wordle.pm | 11 +++++++---- lib/PBot/VERSION.pm | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/PBot/Plugin/Wordle.pm b/lib/PBot/Plugin/Wordle.pm index a4f21f30..f7e037e7 100644 --- a/lib/PBot/Plugin/Wordle.pm +++ b/lib/PBot/Plugin/Wordle.pm @@ -162,13 +162,16 @@ sub wordle($self, $context) { if ($self->{$channel}->{correct}) { my $solved_on = concise ago (time - $self->{$channel}->{solved_on}); - $result .= "; solved by: $self->{$channel}->{solved_by} ($solved_on)"; - } - - if ($self->{$channel}->{givenup}) { + my $wordle = join '', $self->{$channel}->{wordle}->@*; + $result .= "; solved by: $self->{$channel}->{solved_by} ($solved_on); word was: $wordle"; + } elsif ($self->{$channel}->{givenup}) { my $givenup_on = concise ago (time - $self->{$channel}->{givenup_on}); my $wordle = join '', $self->{$channel}->{wordle}->@*; $result .= "; given up by: $self->{$channel}->{givenup_by} ($givenup_on); word was: $wordle"; + } else { + my $guess = $self->{$channel}->{guesses}->[-1]; + $guess =~ s/[^\pL]//g; + $result .= "; last guess: $guess"; } return $result; diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 1a1fdf79..93ff49a0 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4860, + BUILD_REVISION => 4861, BUILD_DATE => "2024-11-27", };