aboutsummaryrefslogtreecommitdiff
path: root/plugin/timezone.pm
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-04-10 15:20:24 +1200
committerDavid Phillips <david@sighup.nz>2018-04-10 15:20:24 +1200
commitcd1fc57841deab0e9b8bcfad49d527c6b263534c (patch)
tree83bc8874a4b6970e0850f9aaca3a8c801bce293c /plugin/timezone.pm
parentbb1808b1ef92af9a14a073f2e14973ac132b7e7e (diff)
downloadidalius-cd1fc57841deab0e9b8bcfad49d527c6b263534c.tar.xz
Correct capitalisation on module names
Diffstat (limited to 'plugin/timezone.pm')
-rw-r--r--plugin/timezone.pm40
1 files changed, 0 insertions, 40 deletions
diff --git a/plugin/timezone.pm b/plugin/timezone.pm
deleted file mode 100644
index 8807d54..0000000
--- a/plugin/timezone.pm
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env perl
-
-package plugin::timezone;
-
-use strict;
-use warnings;
-
-use DateTime;
-
-my %config;
-
-sub configure {
- my $self = $_[0];
- my $cmdref = $_[1];
- my $cref = $_[2];
- %config = %$cref;
-
- $cmdref->("time", sub { $self->time(@_); } );
-
- return $self;
-}
-
-sub time {
- my ($self, $logger, $who, $where, $rest, @arguments) = @_;
-
- my $requester = ( split /!/, $who)[0];
- my @known_zones = (keys %{$config{timezone}});
-
- return "Syntax: time [nick]" unless @arguments == 1;
-
- my $nick = $arguments[0];
- if (grep {$_ eq $nick} @known_zones) {
- my $d = DateTime->now();
- $d->set_time_zone($config{timezone}->{$nick});
- return "$requester: $nick\'s clock reads $d";
- } else {
- return "$requester: I don't know what timezone $nick is in";
- }
-}
-1;