3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-05 19:49:32 +01:00

applets/wiktionary.pl: show list of languages when entry is not found

Requires latest version of https://github.com/pragma-/WiktionaryParser
This commit is contained in:
Pragmatic Software 2024-06-08 09:12:20 -07:00
parent 9b1687d46c
commit da75397b51
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 6 additions and 1 deletions

View File

@ -105,6 +105,11 @@ if ($ENV{DEBUG}) {
print Dumper($entries), "\n"; print Dumper($entries), "\n";
} }
if (@$entries && ref $entries->[0] ne 'HASH') {
print "No entry for `$term` found in $lang; entries found in ", (join ', ', @$entries), "\n";
exit;
}
my @valid_sections = qw/definitions etymology pronunciations participle/; my @valid_sections = qw/definitions etymology pronunciations participle/;
if (not grep { $_ eq $section } @valid_sections) { if (not grep { $_ eq $section } @valid_sections) {

View File

@ -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 => 4758, BUILD_REVISION => 4759,
BUILD_DATE => "2024-06-08", BUILD_DATE => "2024-06-08",
}; };