| View previous topic :: View next topic |
| Author |
Message |
Carlin0 Voice

Joined: 04 Dec 2018 Posts: 24 Location: Italy
|
Posted: Sat Jan 30, 2021 7:30 pm Post subject: [Solved] nick too long |
|
|
is it possible to ban a nick that exceeds a certain number of characters (eg 10 or 11)?
Last edited by Carlin0 on Sun Jan 31, 2021 7:01 pm; edited 1 time in total |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
|
| Back to top |
|
 |
Carlin0 Voice

Joined: 04 Dec 2018 Posts: 24 Location: Italy
|
Posted: Sun Jan 31, 2021 4:48 am Post subject: |
|
|
this works, but it only kicks and you risk making the bot work too much, I would have preferred a ban . |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sun Jan 31, 2021 10:57 am Post subject: |
|
|
try this:
| Code: |
set max_nick_len 10
bind join - * nick_join
bind nick - * nick_change
proc nick_join {nick uhost hand chan} {
global botnick max_nick_len
if {![botisop $chan]} { return 0 }
if [isbotnick $nick] { return 0 }
if {[string length $nick] > $max_nick_len} {
pushmode $chan +b [maskhost $uhost 2]
putkick $chan $nick "Your nickname is too long! use $max_nick_len characters or less"
}
}
proc nick_change {nick uhost hand chan newnick} {
if {![botisop $chan]} { return 0 }
if [isbotnick $newnick] { return 0 }
nick_join $newnick $uhost $hand $chan
}
|
as i mentioned u can block excessive use of chars with 1 banmask
like: | Quote: | | +b ??????????*!*@* |
this saves u the trouble of having to kickban each long nick |
|
| Back to top |
|
 |
Carlin0 Voice

Joined: 04 Dec 2018 Posts: 24 Location: Italy
|
Posted: Sun Jan 31, 2021 6:59 pm Post subject: |
|
|
| thanks, I just made it so that only the nick and not the whole mask were banned, so that changing nick could re-enter |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sun Jan 31, 2021 8:10 pm Post subject: |
|
|
the issue is you will end up with a full banlist since having to set bans on a zillion paterns of nicks that are too long rather than just set 1 ban and get them all wich i mentioned few times
like this banmask bans all nicks that are longer than 9 characters and allow all that are 9 or less
| Quote: | /mode #channel +b ?????????*!*@*
|
|
|
| Back to top |
|
 |
Carlin0 Voice

Joined: 04 Dec 2018 Posts: 24 Location: Italy
|
Posted: Mon Feb 01, 2021 5:37 am Post subject: |
|
|
however with your method people will find themselves banned without knowing why  |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Feb 01, 2021 10:04 am Post subject: |
|
|
| i assume your users connect throu your website you could have some house rules set there but then again im not sure how your users connect. |
|
| Back to top |
|
 |
|