raisedragon / pircbotx

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

bot kick method #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just look into it, i don't think it is working, it isn't giving feedback yet it 
isn't kicking anyone and i would probably think the ban method works the same 
way so you may want to check that thanks 

Original issue reported on code.google.com by italian...@gmail.com on 4 Jun 2011 at 8:43

GoogleCodeExporter commented 9 years ago
Seems to be working fine for me. 

1307243310375 >>>KICK #quackbot Guest43496 :
1307243310531 <<<:Quackbot5!~LQ@*ip* KICK #quackbot Guest43496 :Guest43496

Are you sure the bot is opped? If yes, can you post the log of the kick command?

Original comment by Lord.Qua...@gmail.com on 5 Jun 2011 at 3:14

GoogleCodeExporter commented 9 years ago
ok just did some testing and yes the kick method works sorry my bad, but what 
it is getting hung up on is if i do

Channel channel=new Channel(bot, channelName);
if(channel.isOp(bot.getUser(bot.getNick())))

that doesn't resolve to true, and i oped the bot and the kick method works just 
the isOP method is not working

Original comment by italian...@gmail.com on 5 Jun 2011 at 3:34

GoogleCodeExporter commented 9 years ago
First, you can't get the channel like that. All channels objects are unique and 
creating a new one doesn't add any information about it (internally Channels 
keep their own separate list of the ops in the channel).

In order to properly get the channel object you have to either get the channel 
from the event with getChannel() or bot.getChannel("#channel"); 

Second I did test this out and it worked for me

if (event.getMessage().startsWith("?isOp")) {
    event.respond("" + event.getChannel().isOp(bot.getUser(bot.getNick())));
}

(I'm starting to think I should provide a getBotUser() method as that looks 
terrible)

1307288472750 <<<:LordQuackstar!~TheLQ@*IP* PRIVMSG #quackbot :?isOp
1307288472750 >>>PRIVMSG #quackbot :LordQuackstar: false
1307288478406 <<<:LordQuackstar!~TheLQ@*IP* MODE #quackbot +o Quackbot5
1307288481125 <<<:LordQuackstar!~TheLQ@*IP* PRIVMSG #quackbot :?isOp
1307288481125 >>>PRIVMSG #quackbot :LordQuackstar: true

Original comment by Lord.Qua...@gmail.com on 5 Jun 2011 at 3:50

GoogleCodeExporter commented 9 years ago
Yes that would be helpful a bot.getBotUser() method, also consider making the 
constructor for the channel object protected so no one can use it only your 
package can actually create one

Original comment by italian...@gmail.com on 5 Jun 2011 at 4:46

GoogleCodeExporter commented 9 years ago
Added getUserBot() in Revision ae308e5f296c. And a package private channel 
constructor would really help

Original comment by Lord.Qua...@gmail.com on 5 Jun 2011 at 5:32