/* thanks to nutbar for a lot of the kick code */
alias mk {
    ^local chan ${ischan($0) ? [$0] : C}
    ^local text $remw($chan $*)
    ^local nicks $remw($N $chanusers($chan))
    if (ischanop($N $chan)) {
	fe ($nicks) n1 n2 n3 n4 n5 n6 {
	    quote kick $chan $n1,$n2,$n3,$n4,$n5,$n6 :${@text ? text : [[p] mass kick]}
	}
    }
}
alias lk {
    ^local chan ${ischan($0) ? [$0] : C}
    ^local text $remw($chan $*)
    if (ischanop($N $chan)) {
	fe ($nochops($chan)) n1 n2 n3 n4 n5 n6 {
	    quote kick $chan $n1,$n2,$n3,$n4,$n5,$n6 :${@text ? text : [[p] mass kick on non-ops]}
	}
    }
}

alias bk bankick
alias bankick if ([$*]) {
    ^local chan ${ischan($0) ? [$0] : C}
    ^local nick $word(0 $remw($chan $*))
    ^local text $remw($chan $remw($nick $*))
    if (nick && onchannel($nick $chan) && ischanop($N $chan)) {
	quote mode $chan -o+b $nick $mask(3 $userhost($nick))
	quote kick $chan $nick :${@text ? text : []}
    }
}

alias kb kickban
alias kickban if ([$*]) {
    ^local chan ${ischan($0) ? [$0] : C}
    ^local nick $word(0 $remw($chan $*))
    ^local text $remw($chan $remw($nick $*))
    if (nick && onchannel($nick $chan) && ischanop($N $chan)) {
	quote kick $chan $nick :${@text ? text : []}
        quote mode $chan +b $mask(3 $userhost($nick))
    }
}

alias k kick
alias kick if ([$*]) {
    ^local chan ${ischan($0) ? [$0] : C}
    ^local nick $word(0 $remw($chan $*))
    ^local text $remw($chan $remw($nick $*))
    if (nick && onchannel($nick $chan) && ischanop($N $chan)) {
	quote kick $chan $nick :${@text ? text : []}
    }
}
