From f542cc0cf22dc4552e42241fdd86f1dbac2c7d27 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 23 Oct 2024 22:32:27 -0700 Subject: [PATCH] Core/Factoids: `top20`: show only defined `edited-by` for `edited` sub-command --- lib/PBot/Core/Commands/Factoids.pm | 1 + lib/PBot/VERSION.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PBot/Core/Commands/Factoids.pm b/lib/PBot/Core/Commands/Factoids.pm index 0fecc74a..d0afd7a5 100644 --- a/lib/PBot/Core/Commands/Factoids.pm +++ b/lib/PBot/Core/Commands/Factoids.pm @@ -1430,6 +1430,7 @@ sub cmd_top20($self, $context) { if (lc $args eq 'edited') { my $iter = $factoids->get_each('type = text', "index1 = $channel", 'index2', 'edited_on', 'edited_by', '_sort = -edited_on'); while (defined (my $factoid = $factoids->get_next($iter))) { + last if not defined $factoid->{'edited_on'}; my $ago = concise ago gettimeofday - $factoid->{'edited_on'}; my ($editor) = $factoid->{'edited_by'} =~ /^([^!]+)/; $text .= ' ' . $factoids->get_data($factoid->{index1}, $factoid->{index2}, '_name') . " [$ago by $editor]\n"; diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 6381f5d8..6f687a44 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 => 4810, + BUILD_REVISION => 4811, BUILD_DATE => "2024-10-23", };