I am trying to piece together other scripts i have seen to be able to loop through a list of users on the channel.
Here is what i have come up with
my $channel = @_;
foreach my $nick ($channel->nicks()) {
$server->command("msg $chatchannel $nick->{nick}");
}
But all i get from that is
Can't call method "nicks" without a package or object reference at /root/.irssi/scripts/test.pl line 64.
which is referring to
$channel->nicks()
Am i going about this the wrong way? or should this be working? I have seen many other scripts using $channel->nicks() so i know it must work?
Edit
I should also mention that this is already define further up in the code
my ($server, $msg, $target, $channel, $chatnet) = @_;
But when i try it with that $channel variable i get
Can't locate object method "nicks" via package "mattigins@mattigins.tmi.twitch.tv" (perhaps you forgot to load "mattigins@mattigins.tmi.twitch.tv"?) at /root/.irssi/scripts/test.pl line 64.