3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-28 14:59:56 +01:00

Plugin/Wordle: always have last word/guess in info

This commit is contained in:
Pragmatic Software 2024-11-27 16:51:02 -08:00
parent 6ba8776c2c
commit 80bc79cfbc
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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",
};