From b4cbb213869707b87a5dbc76002b0e037b00a772 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 9 Nov 2025 21:43:07 -0800 Subject: [PATCH] Plugin/Wordle: set player gameid when guessing without a player gameid This ensures the `players` list is populated properly. --- lib/PBot/Plugin/Wordle.pm | 8 ++++---- lib/PBot/VERSION.pm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PBot/Plugin/Wordle.pm b/lib/PBot/Plugin/Wordle.pm index 2de91c15..dfc0d316 100644 --- a/lib/PBot/Plugin/Wordle.pm +++ b/lib/PBot/Plugin/Wordle.pm @@ -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); } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 68042c51..e4fbbe3d 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 => 4925, + BUILD_REVISION => 4926, BUILD_DATE => "2025-11-09", };