Missing methods in Bot.pm in newer versions

7 views
Skip to first unread message

James Ranson

unread,
Dec 6, 2009, 10:58:17 AM12/6/09
to perl-net-jabber-bot
What happened to the User- and Group-related methods that were
available in Net::Jabber::Bot 2.08 (e.g., QueryUserStatus,
RosterGroupExists, etc)?

I would like to upgrade from 2.08 to 2.15, but these required methods
do not exist anymore.

Our bot system is actually a reflector that reflects incoming messages
to all online users in a configured Roster Group, such that no one
must join a conference forum in order to broadcast or receive messages
to the team. Instead a user can message the bot user and the message
will reflect to everyone in the Roster Group. I had actually created
an additional method called GetRosterGroupMembers that just called
$jabber_client{$obj_ID}->RosterDBGroupJIDs($groupname) to get this
going.

But so much has changed in 2.15 that I can't seem to figure out how to
hack this back in anymore.

Todd Rinaldo

unread,
Dec 7, 2009, 6:12:00 PM12/7/09
to perl-net-...@googlegroups.com
Hi, the major change from 2.08 to 2.15 is that it's Moose based not Class::Std

The methods you're referencing are not owned by NJB, but Net::Jabber
instead. When you made these calls, you were making them to
Net::Jabber directly.

Based on your example, this is how your calls would change between the versions:
2.08: $jabber_client{$obj_ID}->RosterDBGroupJIDs($groupname)
2.15: $self->jabber_client->RosterDBGroupJIDs($groupname)

I think the bit you need to understand is how moose variables can be
referenced. anything in the object with a has can be referenced as
$self->has_var

For instance: if you have a line in the object that says has 'foo',
you can reference it in the instantiated object as $object->foo

Much has changed. I don't disagree. If you'd like to share your code
on or off the list, I'd be happy to help you with a quick re-factor.

Thanks,
Todd
Reply all
Reply to author
Forward
0 new messages