devBuzzy / pircbotx

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

ban #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, I'm having some trouble with the ban method. Or perhaps I've overlooked 
something obvious.

What I want to do is, given a user's nick, ban his hostmask.

The bot's ban method takes the hostmask as a parameter but it seems to
use it as a nickname?

What I used : me.getBot().ban(me.getChannel(), 
me.getBot().getUser("user-nick").getHostmask());

The output : mode (+b 69D76E.421593.E5A376.CAC18A!*@*)

It seems I'm supposed to supply the nick and not the hostmask here? Which would 
make this a nick ban.

What I wanted was : mode (+b *!*@69D76E.421593.E5A376.CAC18A)

So I had to use : me.getBot().setMode(me.getChannel(), "+b", "*!*@" + 
me.getBot().getUser("user-nick").getHostmask());

Once again, sorry if I've made some rookie mistake :|

Original issue reported on code.google.com by teh.dev...@gmail.com on 4 Feb 2012 at 2:19

GoogleCodeExporter commented 9 years ago
No worries, you actually did use the wrong hostmask

In the javadoc ( 
http://site.pircbotx.googlecode.com/hg-history/1.6/apidocs/org/pircbotx/PircBotX
.html#ban%28org.pircbotx.Channel,%20java.lang.String%29 ) it shows that a valid 
hostmask is "*!*compu@*.18hp.net". In your example your only giving the 
"*.18hp.net" part. 

Hope this helps

Original comment by Lord.Qua...@gmail.com on 6 Feb 2012 at 1:21