From b62c0da644f2000986b628f7a2e5b6faae8d53ba Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 12 Jul 2020 13:24:25 +1200 Subject: Timezone: Improve error messages for tz --- Plugin/Timezone.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Plugin/Timezone.pm b/Plugin/Timezone.pm index 947bc7a..f3386b2 100644 --- a/Plugin/Timezone.pm +++ b/Plugin/Timezone.pm @@ -45,6 +45,10 @@ sub clock_message { } } +sub make_unknown_zone_message { + return "I'm unsure what the time is for $_[0]"; +} + sub time { my ($self, $irc, $logger, $who, $where, $ided, $rest, $no_reenter, @arguments) = @_; @@ -62,16 +66,13 @@ sub time { my $timestr = $d->strftime("%H:%M on %a %d %b, %Y (%Z)"); return clock_message($nick, $tz, $timestr); } or do { - return "$requester: I'm unsure what the time is for $nick"; + return "$requester: ".make_unknown_zone_message $nick; } } sub zone_convert { my ($self, $irc, $logger, $who, $where, $ided, $rest, $no_reenter, @arguments) = @_; - # tz 1200 from to - # tz 1200 from - my $requester = (split /!/, $who)[0]; return "Syntax: tz