@hook.command('tell')
def tell_cmd(text, nick, db, notice, conn):
 query = text.split(' ', 1)
 if (len(query) != 2):
  notice((conn.config('command_prefix') + tell_cmd.__doc__))
  return
 target = query[0].lower()
 message = query[1].strip()
 sender = nick
 if (target == sender.lower()):
  notice('Have you looked in a mirror lately?')
  return
 if (target.lower() == conn.nick.lower()):
  notice("Invalid nick '{}'.".format(target))
  return
 if (not re.match('^[a-z0-9_|.\\-\\]\\[]*$', target.lower())):
  notice("Invalid nick '{}'.".format(target))
  return
 if (count_unread(db, conn.name, target) >= 10):
  notice('Sorry, {} has too many messages queued already.'.format(target))
  return
 add_tell(db, conn.name, sender, target, message)
 notice('Your message has been saved, and {} will be notified once they are active.'.format(target))

@ hook . command ( 'tell' ) def tell_cmd ( text , nick , db , notice , conn ) : query = text . split ( ' ' , 1 ) if ( len ( query ) != 2 ) : notice ( ( conn . config ( 'command_prefix' ) + tell_cmd . __doc__ ) ) return target = query [ 0 ] . lower ( ) message = query [ 1 ] . strip ( ) sender = nick if ( target == sender . lower ( ) ) : notice ( 'Have you looked in a mirror lately?' ) return if ( target . lower ( ) == conn . nick . lower ( ) ) : notice ( "Invalid nick '{}'." . format ( target ) ) return if ( not re . match ( '^[a-z0-9_|.\\-\\]\\[]*$' , target . lower ( ) ) ) : notice ( "Invalid nick '{}'." . format ( target ) ) return if ( count_unread ( db , conn . name , target ) >= 10 ) : notice ( 'Sorry, {} has too many messages queued already.' . format ( target ) ) return add_tell ( db , conn . name , sender , target , message ) notice ( 'Your message has been saved, and {} will be notified once they are active.' . format ( target ) )
tell <nick> <message> -- relay <message> to <nick> when <nick> is around .