From 0bad6682d0c6a747fd10e38465939c79930238d0 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 26 Nov 2009 00:51:23 -0600 Subject: fix b::bb config a bit --- bin/run | 2 -- lib/Crawl/Bot.pm | 12 ++++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/run b/bin/run index 2555c09..5ce0f74 100644 --- a/bin/run +++ b/bin/run @@ -8,6 +8,4 @@ Crawl::Bot->new( server => 'irc.freenode.net', channels => ['##crawl-dev'], nick => 'crawl-dev', - username => 'crawl-dev', - name => 'crawl-dev', )->run; diff --git a/lib/Crawl/Bot.pm b/lib/Crawl/Bot.pm index e6a5e15..ccaa29e 100644 --- a/lib/Crawl/Bot.pm +++ b/lib/Crawl/Bot.pm @@ -6,6 +6,14 @@ extends 'Bot::BasicBot'; use autodie; use XML::RAI; +has [qw(username name)] => ( + # don't need (or want) accessors, just want to initialize the hash slot + # for B::BB to use + is => 'bare', + isa => 'Str', + default => sub { shift->nick }, +); + has rss_feed => ( is => 'ro', isa => 'Str', @@ -91,9 +99,9 @@ sub tick { return if $self->has_item($id); warn "New issue! ($id)"; $self->say( - channel => '##crawl-dev', + channel => $_, body => $item->title . ' (' . $item->link . ')' - ); + ) for $self->channels; $self->add_item($id); }); $self->save_cache; -- cgit v1.2.3-54-g00ecf