diff --git a/lib/PBot/Plugin/Wordle.pm b/lib/PBot/Plugin/Wordle.pm index ec9e9c43..e5bc385f 100644 --- a/lib/PBot/Plugin/Wordle.pm +++ b/lib/PBot/Plugin/Wordle.pm @@ -29,7 +29,7 @@ sub unload($self) { } use constant { - USAGE => 'Usage: wordle start [length [wordlist]] | custom [wordlist] | guess | letters | show | giveup', + USAGE => 'Usage: wordle start [length [wordlist]] | custom [wordlist] | guess | letters | show | info | giveup', NO_WORDLE => 'There is no Wordle yet. Use `wordle start` to begin a game.', DEFAULT_LIST => 'american', @@ -152,6 +152,14 @@ sub wordle($self, $context) { return $self->show_wordle($channel, 1); } + when ('info') { + if (not defined $self->{$channel}->{wordle}) { + return NO_WORDLE; + } + + return "Current wordlist: $self->{$channel}->{wordlist} ($self->{$channel}->{length}); guesses attempted: $self->{$channel}->{guess_count}\n"; + } + when ('giveup') { if (not defined $self->{$channel}->{wordle}) { return NO_WORDLE; @@ -168,10 +176,6 @@ sub wordle($self, $context) { return "Invalid arguments; Usage: wordle start [word length [wordlist]]"; } - if (defined $self->{$channel}->{wordle} && $self->{$channel}->{correct} == 0) { - return "There is already a Wordle underway! Use `wordle show` to see the current progress or `wordle giveup` to end it."; - } - my $length = DEFAULT_LENGTH; my $wordlist = $args[1] // DEFAULT_LIST; @@ -191,6 +195,10 @@ sub wordle($self, $context) { $length = $args[0]; } + if (defined $self->{$channel}->{wordle} && $self->{$channel}->{correct} == 0) { + return "There is already a Wordle underway! Use `wordle show` to see the current progress or `wordle giveup` to end it."; + } + return $self->make_wordle($channel, $length, undef, $wordlist); } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 8a4a0f71..19862876 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4800, - BUILD_DATE => "2024-10-06", + BUILD_REVISION => 4801, + BUILD_DATE => "2024-10-15", }; sub initialize {}