zD12 / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

Channel.getUsers only returns the bot as User #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Call to getUsers will not return a set of all the users on the channel, but 
just one user, which would be the bot.

Steps to reproduce:

1. Connect the bot to a channel with several users
2. Issue a command/message to the bot
3. List all users on channel
4. Only bot name in the list

Original issue reported on code.google.com by barand...@gmail.com on 12 May 2013 at 6:03

GoogleCodeExporter commented 9 years ago
Could you provide a SSCCE (google it) for us please?

Original comment by entityreborn on 12 May 2013 at 6:07

GoogleCodeExporter commented 9 years ago
Hold on, it might not be a bug, but me misunderstanding the behaviour. When 
calling getUsers, should it only return the users which have joined the channel 
after the bot has joined the channel, as opposed to returning all the users on 
the channel?

Original comment by barand...@gmail.com on 12 May 2013 at 6:54

GoogleCodeExporter commented 9 years ago
I forgot to mention this affects PircBotX 2.0

Original comment by barand...@gmail.com on 12 May 2013 at 7:57

GoogleCodeExporter commented 9 years ago
I am unable to reproduce this, so this might of been a bug in the snapshot 
version you were using. My code (sorry for the Guava awkwardness)

if (event.getMessage().startsWith("?users"))
    event.respond(Joiner.on(", ").join(Iterables.transform(event.getChannel().getUsers(), new Function<User, String>() {
        public String apply(User input) {
            return input.getNick();
        }
    })));

Gives in the #pircbotx channel

<TheLQ> ?users
<PircBotX> TheLQ: __import__, boozaa, Glavata, m0sf3t, PircBotX, sirecote, 
TheLQ, TheLQ-BeeJenkins, TheLQ-PircBotX, tilal6991

Original comment by Lord.Qua...@gmail.com on 15 Jun 2013 at 6:54