mirror of
https://github.com/pragma-/pbot.git
synced 2025-11-13 04:57:26 +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:
parent
73ac6a3a4b
commit
b4cbb21386
@ -240,10 +240,6 @@ sub wordle($self, $context) {
|
|||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not exists $self->{games}->{$channel}->{$gameid}) {
|
|
||||||
return "$context->{nick}: " . NO_GAMEID;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (not defined $args[0]) {
|
if (not defined $args[0]) {
|
||||||
return "$context->{nick}: You are playing the $gameid Wordle.";
|
return "$context->{nick}: You are playing the $gameid Wordle.";
|
||||||
} else {
|
} else {
|
||||||
@ -500,6 +496,10 @@ sub wordle($self, $context) {
|
|||||||
return $game . NO_WORDLE;
|
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}) {
|
if ($self->{games}->{$channel}->{$gameid}->{solved}) {
|
||||||
return "${game}Wordle already solved by $self->{games}->{$channel}->{$gameid}->{solved_by}. " . $self->show_wordle($channel, $gameid);
|
return "${game}Wordle already solved by $self->{games}->{$channel}->{$gameid}->{solved_by}. " . $self->show_wordle($channel, $gameid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4925,
|
BUILD_REVISION => 4926,
|
||||||
BUILD_DATE => "2025-11-09",
|
BUILD_DATE => "2025-11-09",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user