{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/discord-webhook/latest.json",
  "title": "Discord Webhook",
  "description": "Discord Webhook JSON Schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/AxoCode/json-schema/master/discord/webhook.json",
    "sourceSha256": "c865562cd83313a1db74da6f56f541ff7fca861597a83397082a7e9927d9def1"
  },
  "type": "object",
  "properties": {
    "$schema": {
      "description": "Allow $schema because additionalProperties is false",
      "$ref": "#/$defs/string"
    },
    "content": {
      "description": "The message contents\nMax is 2000 characters",
      "$ref": "#/$defs/string",
      "maxLength": 2000
    },
    "username": {
      "description": "Override the default username of the webhook\nName cannot contain \"clyde\"",
      "$ref": "#/$defs/string",
      "pattern": "^((?!(c|C)(l|L)(y|Y)(d|D)(e|E)).)*$",
      "maxLength": 80
    },
    "avatar_url": {
      "description": "Override the default avatar of the webhook",
      "$ref": "#/$defs/url"
    },
    "tts": {
      "description": "Whether or not this message will play in TTS\nDefault is false",
      "$ref": "#/$defs/boolean"
    },
    "embeds": {
      "description": "Embedded rich content\nMax is 6000 characters",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "description": "Title of embed\nMax is 256 characters",
            "$ref": "#/$defs/string",
            "maxLength": 256
          },
          "description": {
            "description": "Description of embed\nMax is 4096 characters",
            "$ref": "#/$defs/string",
            "maxLength": 4096
          },
          "url": {
            "description": "URL of embed\nOnly support http / https",
            "$ref": "#/$defs/url"
          },
          "timestamp": {
            "description": "Timestamp of embed content\nISO8601 Timestamp",
            "$ref": "#/$defs/string",
            "format": "date-time"
          },
          "color": {
            "description": "Color code of the embed\nOnly support color in decimal\nTo match embed background color, use 3092790\nDefault is 2105893",
            "type": "integer",
            "default": 2105893,
            "minimum": 0,
            "maximum": 16777215
          },
          "footer": {
            "description": "Footer information",
            "type": "object",
            "properties": {
              "text": {
                "description": "Footer text\nMax is 2048 characters",
                "type": "string",
                "default": "",
                "maxLength": 2048
              },
              "icon_url": {
                "description": "URL of footer icon\nOnly support http / https",
                "$ref": "#/$defs/url"
              }
            },
            "required": [
              "text"
            ],
            "additionalProperties": false
          },
          "image": {
            "description": "Image information",
            "type": "object",
            "properties": {
              "url": {
                "description": "Source url of image\nOnly support http / https",
                "$ref": "#/$defs/url"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          },
          "thumbnail": {
            "description": "Thumbnail information",
            "type": "object",
            "properties": {
              "url": {
                "description": "Source url of thumbnail\nOnly support http / https",
                "$ref": "#/$defs/url"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          },
          "author": {
            "description": "Author information",
            "type": "object",
            "properties": {
              "name": {
                "description": "Name of author\nMax is 256 characters",
                "$ref": "#/$defs/string",
                "maxLength": 256
              },
              "url": {
                "description": "URL of author\nOnly support http / https",
                "$ref": "#/$defs/url"
              },
              "icon_url": {
                "description": "URL of author icon\nOnly support http / https",
                "$ref": "#/$defs/url"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "fields": {
            "description": "Fields information",
            "type": "array",
            "items": {
              "description": "Fields information",
              "type": "object",
              "properties": {
                "name": {
                  "description": "Name of the field\nREQUIRED Max is 256",
                  "$ref": "#/$defs/string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "value": {
                  "description": "Value of the field\nREQUIRED Max is 1024",
                  "$ref": "#/$defs/string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "inline": {
                  "description": "Whether or not this field should display inline\nDefault is false",
                  "$ref": "#/$defs/boolean"
                }
              },
              "required": [
                "name",
                "value"
              ],
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      }
    },
    "allowed_mentions": {
      "description": "Allowed mentions for the message",
      "type": "object",
      "minProperties": 1,
      "properties": {
        "parse": {
          "description": "An array of allowed mention types to parse from the content.",
          "type": "array",
          "default": [],
          "items": {
            "type": "string",
            "enum": [
              "roles",
              "users",
              "everyone"
            ]
          }
        },
        "roles": {
          "description": "Array of role_ids to mention\nMax is 100 of role_ids\nMutually exclusive with parse roles",
          "type": [
            "array",
            "null"
          ],
          "default": [],
          "uniqueItems": true,
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/id"
          }
        },
        "users": {
          "description": "Array of user_ids to mention\nMax is 100 of user_ids\nMutually exclusive with parse users",
          "type": [
            "array",
            "null"
          ],
          "default": [],
          "uniqueItems": true,
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/id"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "string": {
      "type": "string",
      "default": ""
    },
    "boolean": {
      "type": "boolean",
      "default": false
    },
    "url": {
      "$ref": "#/$defs/string",
      "pattern": "^https?://"
    },
    "id": {
      "$ref": "#/$defs/string",
      "pattern": "^\\d+$"
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "content"
      ]
    },
    {
      "required": [
        "embeds"
      ]
    }
  ]
}
