Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify Clock module.

  • Loading branch information...
commit 25e685e4498be8a3a76309dc52cae9b7b4d15099 1 parent a5ea445
vasily.chekalkin authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/Bot/BasicBot/Pluggable/Module/Clock.pm
View
7 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));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.