#NEWLINE# def ban( channel , hostmask , exception = '' , prefix = '' , msg = None ) : #NEWLINE# #INDENT# 'Returns a MODE to ban nick on channel.' #NEWLINE# if conf . supybot . protocols . irc . strictRfc ( ) : #NEWLINE# #INDENT# assert isChannel ( channel ) , repr ( channel ) #NEWLINE# assert isUserHostmask ( hostmask ) , repr ( hostmask ) #NEWLINE# #UNINDENT# modes = [ ( '+b' , hostmask ) ] #NEWLINE# if prefix : #NEWLINE# #INDENT# modes . append ( ( '+e' , exception ) ) #NEWLINE# #UNINDENT# if ( msg and ( not prefix ) ) : #NEWLINE# #INDENT# prefix = msg . prefix #NEWLINE# #UNINDENT# return IrcMsg ( prefix = prefix , command = 'MODE' , args = ( [ channel ] + ircutils . joinModes ( modes ) ) , msg = msg )