| 1 | package POE::Component::IRC::Plugin::ColorNamer; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | our $VERSION = '2.001004'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use App::ColorNamer; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use base 'POE::Component::IRC::Plugin::BaseWrap'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub _make_default_args { | ||||||||
|
Subroutine
_make_default_args: not called CC=1 SCAR=6.9
| |||||||||||
| 12 | return ( | ||||||||||
| 13 | 0 | trigger => qr/^color\s*namer\s+(?=\S+$)/i, | |||||||||
| 14 | response_event => 'irc_colornamer', | ||||||||||
| 15 | ); | ||||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub _make_response_message { | ||||||||
|
Subroutine
_make_response_message: not called CC=4 SCAR=30.0
| |||||||||||
| 19 | 0 | my ( $self, $in_ref ) = @_; | |||||||||
| 20 | |||||||||||
| 21 | 0 | my $is_sane_only = $in_ref->{what} =~ s/^://; | |||||||||
| 22 | |||||||||||
| 23 | 0 | my $app = App::ColorNamer->new; | |||||||||
| 24 | |||||||||||
| 25 | $app->sane_colors( $self->{sane_colors} ) | ||||||||||
| 26 | 0 | ▶ | if $self->{sane_colors}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | |||||||||||
| 28 | 0 | my $name = $app->get_name( $in_ref->{what}, $is_sane_only ); | |||||||||
| 29 | |||||||||||
| 30 | 0 | my $out; | |||||||||
| 31 | 0 | ▶ | if ( $name ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | $out = "$name->{name} (#$name->{hex}" | ||||||||||
| 33 | 0 | ▶ | . ( $name->{exact} ? ', exact match)' : ')' ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | } | ||||||||||
| 35 | else { | ||||||||||
| 36 | 0 | $out = 'Error: ' . $app->error; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | return $out; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub _message_into_response_event { 'result' } | ||||||||
|
Subroutine
_message_into_response_event: not called CC=1 SCAR=6.9
| |||||||||||
| 43 | |||||||||||
| 44 | 1 | 1; | |||||||||
| 45 | __END__ | ||||||||||