Perl API - send an IM

Greg Chagnon gcgaim at gmail.com
Mon Jul 9 15:35:59 EDT 2007


Hi,
So I'm looking for the most basic way to send an IM to another person using
the perl API.  This is what I'm trying and it's not working.  Can anyone
offer any help?  Thanks.


    my $plugin = shift;
    my $protocol = "prpl-yahoo";
    my $account_name = "test1";

    $account = Purple::Accounts::find($account_name, $protocol);

    $conv1 = Purple::Conversation->new(1, $account, "Test Conversation 1");

    $im = $conv1->get_im_data();

    $im->send("Message Test.");

Should $account_name  be the account that I want to send the IM to?  Or is
that who it's from?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20070709/06d5e50d/attachment.html>


More information about the Devel mailing list