code: def serialize(self) -> dict:
          
          data = {**self}
          if "attachments" in self:
              data["attachments"] = json.dumps(self["attachments"])
          return data
docs: Serialize the message for sending to slack API
  
          Returns:
              serialized message