Skip Menu |

This queue is for tickets about the Bot-BasicBot CPAN distribution.

Report information
The Basics
Id: 62900
Status: resolved
Priority: 0/
Queue: Bot-BasicBot

People
Owner: Nobody in particular
Requestors: MSCHILLI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.83
Fixed in: (no value)



The said() callback is missing the ->{who}, ->{body} etc. fields in version 0.83. It worked fine in 0.82.
Really? Works for me, using the attached example code. The only change to said() that was done for 0.83 was to pay attention to its return value even when it is false (yet defined).
Subject: bot.pl
#!/usr/bin/env perl use strict; use warnings; { package FooBot; use strict; use warnings; use Bot::BasicBot; use base 'Bot::BasicBot'; sub said { my ($self, $args) = @_; use Devel::Dwarn; Dwarn $args; } } my $bot = FooBot->new( server => "irc.perl.org", channels => ["#bots"], nick => "basicbotewr23r", ); $bot->run();
On Wed Nov 10 13:40:57 2010, HINRIK wrote: Show quoted text
> Really? Works for me, using the attached example code. The only change > to said() that was done for 0.83 was to pay attention to its return > value even when it is false (yet defined).
Thanks for your prompt response! Odd, I installed 0.83 again and now I see the data structure (by the way, the documentation doesn't say it's the 2nd parameter to the callback) intact. Not sure why I didn't see it before, but now I get Can't PRIVMSG without target and body called from Bot::BasicBot line 1232 who = '#ymtest' body = '' when I return "" (empty string) from the callback. Going back to 0.82, the warning goes away. I'm using POE::Component::IRC 6.52 if that's of any help.
On Thu Nov 11 03:25:20 2010, MSCHILLI wrote: Show quoted text
> by the way, the documentation doesn't say it's > the 2nd parameter to the callback
The documentation does say that it's a method, which indicates that the first parameter is the invocant, but the heading says "said($args)" which might be interpreted as a function. I'll make the docs clearer. Show quoted text
> Not sure why I didn't see it before, but now I get > > Can't PRIVMSG without target and body > called from Bot::BasicBot line 1232 > who = '#ymtest' > body = '' > > when I return "" (empty string) from the callback. Going back to 0.82, > the warning goes away.
I'll add a case to ignore the return value if it has no length (it was ignoring all false values in 0.82, of course).
Great, thanks!
Subject: Closing this again
This should't have been reopened. Silly RT.