code: def encode(cls, command):
          
  
          args = []
          for arg in command.args:
              if not isinstance(arg, str):
                  arg = str(arg)
  
              if "," in arg or arg.startswith(" ") or arg.endswith(" ") or arg.startswith("hex:"):
                  arg = "hex:{}".format(hexlify(arg.encode('utf-8')).decode('utf-8'))
  
              args.append(arg)
  
          argstr = ""
  
          if len(args) > 0:
              argstr = " {" + ",".join(args) + "}"
  
          return command.name + argstr
docs: Encode a command as an unambiguous string.
  
          Args:
              command (Command): The command to encode.
  
          Returns:
              str: The encoded command