:nick completion
:module
:

^on ^input "*" {
	if (strlen($before(: $0)) > 1 && right(1 $0)==[$nick_completion_char]) {
	        @ nick = before(: $0)
	        if (pattern(*$nick* $chanusers($T))) {
		        @ nick2 = word(0 $pattern(*$nick* $chanusers($T)))
		        sendline $stripansicodes($fparse(format_nick_comp $nick2 $1-))
	        }
		{
			sendline $*
		}
	}
	{
		sendline $*	
	}
	^assign nick
	^assign nick2
}