code: def construct(self, force=False):
          
          # Sanity check for command.
          command = str(self.command)
          if not protocol.COMMAND_PATTERN.match(command) and not force:
              raise pydle.protocol.ProtocolViolation('The constructed command does not follow the command pattern ({pat})'.format(pat=protocol.COMMAND_PATTERN.pattern), message=command)
          message = command.upper()
  
          # Add parameters.
          if not self.params:
              message += ' '
          for idx, param in enumerate(self.params):
              # Trailing parameter?
              if not param or ' ' in param or param[0] == ':':
                  if idx + 1 < len(self.params) and not force:
                      raise pydle.protocol.ProtocolViolation('Only the final parameter of an IRC message can be trailing and thus contain spaces, or start with a colon.', message=param)
                  message += ' ' + protocol.TRAILING_PREFIX + param
              # Regular parameter.
              else:
                  message += ' ' + param
  
          # Prepend source.
          if self.source:
              message = ':' + self.source + ' ' + message
  
          # Sanity check for characters.
          if any(ch in message for ch in protocol.FORBIDDEN_CHARACTERS) and not force:
              raise pydle.protocol.ProtocolViolation('The constructed message contains forbidden characters ({chs}).'.format(chs=', '.join(protocol.FORBIDDEN_CHARACTERS)), message=message)
  
          # Sanity check for length.
          message += protocol.LINE_SEPARATOR
          if len(message) > protocol.MESSAGE_LENGTH_LIMIT and not force:
              raise pydle.protocol.ProtocolViolation('The constructed message is too long. ({len} > {maxlen})'.format(len=len(message), maxlen=protocol.MESSAGE_LENGTH_LIMIT), message=message)
  
          return message
docs: Construct a raw IRC message.