summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-07-08 16:00:25 -0500
committerNeil Moore <neil@s-z.org>2012-07-08 16:00:25 -0500
commitca5a4c14b1d66eb090ed2813293d8e41c3a072ae (patch)
tree7c12c59e3e4508a7f65a0ded42b27b2f29945684 /lib
parent938bdb2c3dd25fba032da6d0bc8d519c8285ab0c (diff)
downloadcrawlbot-ca5a4c14b1d66eb090ed2813293d8e41c3a072ae.tar.gz
crawlbot-ca5a4c14b1d66eb090ed2813293d8e41c3a072ae.zip
Don't log (most) other events from ##crawl.
Only nick changes and topic changes are now logged from non-primary channels; the former because the API gives no no other choice, and the latter because it might be nice to see them.
Diffstat (limited to 'lib')
-rw-r--r--lib/Crawl/Bot/Plugin/Logging.pm24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/Crawl/Bot/Plugin/Logging.pm b/lib/Crawl/Bot/Plugin/Logging.pm
index 05748fb..453b793 100644
--- a/lib/Crawl/Bot/Plugin/Logging.pm
+++ b/lib/Crawl/Bot/Plugin/Logging.pm
@@ -79,7 +79,9 @@ sub emoted {
my $self = shift;
my ($args) = @_;
- $self->log_message("* $args->{who} $args->{body}");
+ if ($args->{channel} eq $self->bot->{channels}[0]) {
+ $self->log_message("* $args->{who} $args->{body}");
+ }
return;
}
@@ -87,7 +89,9 @@ sub chanjoin {
my $self = shift;
my ($args) = @_;
- $self->log_message("-!- $args->{who} has joined $args->{channel}");
+ if ($args->{channel} eq $self->bot->{channels}[0]) {
+ $self->log_message("-!- $args->{who} has joined $args->{channel}");
+ }
return;
}
@@ -95,7 +99,9 @@ sub chanpart {
my $self = shift;
my ($args) = @_;
- $self->log_message("-!- $args->{who} has left $args->{channel}");
+ if ($args->{channel} eq $self->bot->{channels}[0]) {
+ $self->log_message("-!- $args->{who} has left $args->{channel}");
+ }
return;
}
@@ -104,6 +110,7 @@ sub nick_change {
# bleh... uses different arg format
my ($old, $new) = @_;
+ # I guess we get nick changes everywhere *sigh*
$self->log_message("-!- $old is now known as $new");
return;
}
@@ -112,7 +119,9 @@ sub kicked {
my $self = shift;
my ($args) = @_;
- $self->log_message("-!- $args->{kicked} was kicked from $args->{channel} by $args->{who} [$args->{reason}]");
+ if ($args->{channel} eq $self->bot->{channels}[0]) {
+ $self->log_message("-!- $args->{kicked} was kicked from $args->{channel} by $args->{who} [$args->{reason}]");
+ }
return;
}
@@ -120,6 +129,7 @@ sub topic {
my $self = shift;
my ($args) = @_;
+ # Might as well log this for ##crawl as well.
if (defined($args->{who})) {
$self->log_message("-!- $args->{who} changed the topic of $args->{channel} to: $args->{topic}");
}
@@ -133,7 +143,9 @@ sub userquit {
my $self = shift;
my ($args) = @_;
- $self->log_message("-!- $args->{who} has quit [$args->{body}]");
+ if ($args->{channel} eq $self->bot->{channels}[0]) {
+ $self->log_message("-!- $args->{who} has quit [$args->{body}]");
+ }
return;
}
@@ -141,7 +153,7 @@ sub sent {
my $self = shift;
my ($args) = @_;
- unless ($args->{channel} eq 'msg') {
+ if ($args->{channel} eq $self->bot->{channels}[0]) {
$self->log_message("<$args->{who}> $args->{body}");
}
return;