#NEWLINE# @ irc3d . command #NEWLINE# def PRIVMSG( self , client = None , args = None , event = 'PRIVMSG' , **kwargs ) : #NEWLINE# #INDENT# ' PRIVMSG will send a standard message to the user or channel\n        specified.\n\n        PRIVMSG supports the following prefixes for sending messages to\n        specific clients in a channel:\n\n        @ - channel operators only\n        + - channel operators and voiced users\n\n        The nick can be extended to fit into the following syntax:\n\n        username@servername\n\n        This syntax is used to securely send a message to a service or a bot.\n\n            %%PRIVMSG <target> <:message>...\n        ' #NEWLINE# dest = args [ '<target>' ] #NEWLINE# target = self . nicks . get ( args , None ) #NEWLINE# if ( target is not None ) : #NEWLINE# #INDENT# clients = [ target ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# clients = self . channels . get ( dest , set ( ) ) #NEWLINE# clients = clients . difference ( { client . nick } ) #NEWLINE# #UNINDENT# if clients : #NEWLINE# #INDENT# data = ' ' . join ( args [ '<:message>' ] ) #NEWLINE# if ( not data . startswith ( ':' ) ) : #NEWLINE# #INDENT# data = ( ':' + data ) #NEWLINE# #UNINDENT# self . broadcast ( client = client , broadcast = ':{c.mask} {event} {<target>} {data}' . format ( c = client , target = target , event = event , data = data , ** args ) , clients = clients ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dest not in self . channels ) : #NEWLINE# #INDENT# client . fwrite ( rfc . ERR_NOSUCHNICK , nick = dest )