Best way to build an userlist by level

20 views
Skip to first unread message

Matheus Henrique da Silva

unread,
Sep 16, 2015, 10:06:19 AM9/16/15
to pircbotx
I want to get the userlist and rebuild then according to the levels.
So i wanna all owners, then all superops, then all ops, etc.
How is the best way to get this?

Thanks in advance.

Leon Blakey

unread,
Sep 16, 2015, 10:44:55 PM9/16/15
to pirc...@googlegroups.com
Would something like this work?

Channel curChannel = event.getChannel();
        for(User curUser : curChannel.getUsers()) {
            Set<UserLevel> levels = curChannel.getUserLevels(curUser);
            //do stuff
        }
       
        //or (hardcoded)
        Set<User> ops = curChannel.getOps();
        Set<User> voice = curChannel.getVoices();
        Set<User> owners = curChannel.getOwners();
        Set<User> superOps = curChannel.getSuperOps();
        Set<User> halfOps = curChannel.getHalfOps();

--
You received this message because you are subscribed to the Google Groups "pircbotx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pircbotx+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matheus Henrique da Silva

unread,
Sep 17, 2015, 7:23:27 AM9/17/15
to pircbotx
Thank u very much.
Reply all
Reply to author
Forward
0 new messages