Permalink
Browse files

Simplify Clock module.

  • Loading branch information...
1 parent a5ea445 commit 25e685e4498be8a3a76309dc52cae9b7b4d15099 vasily.chekalkin committed Sep 28, 2010
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/Bot/BasicBot/Pluggable/Module/Clock.pm
@@ -12,9 +12,8 @@ my %tz = (
UTC => 'UTC',
);
-sub said {
- my ( $self, $message, $priority ) = @_;
- return unless ( $priority == 2 );
+sub told {
+ my ( $self, $message ) = @_;
( my $msg_body = $message->{'body'} ) =~ s/^\s+//;
if ($msg_body eq 'clock?') {
@@ -23,7 +22,7 @@ sub said {
local $ENV{TZ} = $tz;
push @dates, strftime("$name: %a, %H:%M %Z", localtime());
}
- $self->reply($message, join(' / ', @dates));
+ $self->reply($message, $message->{who} . ': ' . join(' / ', @dates));
}
}

0 comments on commit 25e685e

Please sign in to comment.