code: def help(rest):
  	
  	rs = rest.strip()
  	if rs:
  		# give help for matching commands
  		for handler in Handler._registry:
  			if handler.name == rs.lower():
  				yield '!%s: %s' % (handler.name, handler.doc)
  				break
  		else:
  			yield "command not found"
  		return
  
  	# give help for all commands
  	def mk_entries():
  		handlers = (
  			handler
  			for handler in Handler._registry
  			if type(handler) is pmxbot.core.CommandHandler
  		)
  		handlers = sorted(handlers, key=operator.attrgetter('name'))
  		for handler in handlers:
  			res = "!" + handler.name
  			if handler.aliases:
  				alias_names = (alias.name for alias in handler.aliases)
  				res += " (%s)" % ', '.join(alias_names)
  			yield res
  	o = io.StringIO(" ".join(mk_entries()))
  	more = o.read(160)
  	while more:
  		yield more
  		time.sleep(0.3)
  		more = o.read(160)
docs: Help (this command)