1

Bot::BasicBot provides a method for fetching the handle of the underlying POE::Component::IRC::State object, pocoirc(). Using this object handle, it seems like it should be possible to send a raw message like this:

sub said {
  my ($self, $message) = @_;
  $self->pocoirc()->yield('raw_events' => 1);
  $self->pocoirc()->yield('irc_raw_out' => 'RAW message');

However, this gives the error "Can't call method "yield" without a package or object reference" - the returned object doesn't seem to export the expected method. Have I misunderstood what kind of object I'm getting back, or how to trigger sending of a raw message?

  • What does the `$self` object look like when inspected with Data::Printer? – simbabque Sep 21 '15 at 15:31
  • 1
    That's not telling you that the returned object doesn't have a given method, it's telling you that `$self->pocoirc()` is undef. – hobbs Sep 21 '15 at 15:33

1 Answers1

0

Thanks to the tip about Data::Printer, it turns out that the POE::Kernel is available as self->{kernel}. To enqueue a raw command,

$self->{kernel}->post( $self->{IRCNAME}, 'quote', 'your raw command');