From da75397b513955fefdfd6f745512c3917d597dd9 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 8 Jun 2024 09:12:20 -0700 Subject: [PATCH] applets/wiktionary.pl: show list of languages when entry is not found Requires latest version of https://github.com/pragma-/WiktionaryParser --- applets/wiktionary.pl | 5 +++++ lib/PBot/VERSION.pm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/applets/wiktionary.pl b/applets/wiktionary.pl index 69992a24..f2ed0846 100755 --- a/applets/wiktionary.pl +++ b/applets/wiktionary.pl @@ -105,6 +105,11 @@ if ($ENV{DEBUG}) { 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/; if (not grep { $_ eq $section } @valid_sections) { diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 06e7a313..dd8e8c90 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 => 4758, + BUILD_REVISION => 4759, BUILD_DATE => "2024-06-08", };