« blib/lib/App/Horris/CLI/Command/twitter_stream.pm
↑ Summary
blib/lib/Horris/Connection/Plugin/Retry.pm »
| 1 | package Horris::Connection::Plugin::PowerManager; | ||
| 2 | # ABSTRACT: PowerManager Plugin on Horris | ||
| 3 | |||
| 4 | |||
| 5 | use Moose; | ||
| 6 | extends 'Horris::Connection::Plugin'; | ||
| 7 | with 'MooseX::Role::Pluggable::Plugin'; | ||
| 8 | |||
| 9 | sub irc_privmsg { | ||
| 10 | my ($self, $message) = @_; | ||
| 11 | my $msg = $message->message; | ||
| 12 | my $botname = $self->connection->nickname; | ||
| 13 | $self->connection->irc->disconnect if $msg =~ m{^$botname\S*\s+(:?꺼져|껒여|exit|quit)}; | ||
| 14 | return $self->pass; | ||
| 15 | } | ||
| 16 | |||
| 17 | __PACKAGE__->meta->make_immutable; | ||
| 18 | |||
| 19 | 1; | ||
| 20 | |||
| 21 | __END__ |