3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-11-12 20:47:21 +01:00

Plugin/Wordle: set player gameid when guessing without a player gameid

This ensures the `players` list is populated properly.
This commit is contained in:
Pragmatic Software 2025-11-09 21:43:07 -08:00
parent 73ac6a3a4b
commit b4cbb21386
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 5 additions and 5 deletions

View File

@ -240,10 +240,6 @@ sub wordle($self, $context) {
return $error;
}
if (not exists $self->{games}->{$channel}->{$gameid}) {
return "$context->{nick}: " . NO_GAMEID;
}
if (not defined $args[0]) {
return "$context->{nick}: You are playing the $gameid Wordle.";
} else {
@ -500,6 +496,10 @@ sub wordle($self, $context) {
return $game . NO_WORDLE;
}
if (!exists $self->{players}->{$channel} || !exists $self->{players}->{$channel}->{$context->{message_account}}) {
$self->{players}->{$channel}->{$context->{message_account}}->{gameid} = $gameid;
}
if ($self->{games}->{$channel}->{$gameid}->{solved}) {
return "${game}Wordle already solved by $self->{games}->{$channel}->{$gameid}->{solved_by}. " . $self->show_wordle($channel, $gameid);
}

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 => 4925,
BUILD_REVISION => 4926,
BUILD_DATE => "2025-11-09",
};