sub convos{<br /> my ($bot,$self, $user, $name, $msg, $color) = @_;<br /><br /> foreach my $handle (keys %{$bot->{msn}}){<br /> foreach my $convo (values %{$bot->{msn}->{$handle}->getConvoList()})<br /> {<br /> $users = join(", ",keys %{$convo->getMembers()});<br /> $reply .= "$handle -- $convo->getId . => $users\n";<br /><br /> }<br /> }<br />return $reply;<br />}<br />{<br /> Category => 'MOD',<br /> Description => 'SHOWS A LIST OF CONVOS',<br /> Usage => '!convos',<br />};
Am i using the methods correctly? Im looking through the docs and seeing no documentation of some of these so im starting to wonder wether they're old or just not documented. Im Preety sure it worked witout mirrors but dont hold me to that...Its not just this i want it for, but my kick command stopped working and i think its because of the same reason.
Also (I think) $convo is actually just the key value pair. It is not a refrence to the actuall variable. so the code should look more like:
Code:
<br />$bot->{msn}->{$handle}->$convo->getId<br />
I don't know where getId really is so that might be wrong but it is definately within $bot->{msn}->{$handle}
Hope that helps a little [right][snapback]46676[/snapback][/right]
$convo is the reference to the current convosation in the foreach. it'd be the same as using $self but i cant use self because that would only bring up the one im using, You're code crashes because it has no object.
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Wed Mar 09, 2005 4:53 pm Post subject:
Add
Code:
<br />my $reply;<br />
At the top of the command so that reply isn't global. Then breack out the call to getID, you can't call a method inside a string like this... well i don't think you can. Anyway this is more likelye to work.