Last active
January 1, 2024 12:29
-
-
Save Blad3Mak3r/637fbcde7d3be22c9624912bb28146fe to your computer and use it in GitHub Desktop.
Discord Slash Command Schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "Discord Slash Command Schema", | |
"type": "object", | |
"properties": { | |
"type": { | |
"type": "integer", | |
"description": "Tipo de comando. Por defecto es 1.", | |
"default": 1, | |
"enum": [1, 2, 3] | |
}, | |
"name": { | |
"type": "string", | |
"description": "El nombre del comando.", | |
"minLength": 1, | |
"maxLength": 32 | |
}, | |
"description": { | |
"type": "string", | |
"description": "La descripción del comando.", | |
"minLength": 1, | |
"maxLength": 100 | |
}, | |
"options": { | |
"type": "array", | |
"items": { "$ref": "#/definitions/option" }, | |
"description": "Las opciones para el comando.", | |
"maxItems": 25 | |
}, | |
"default_member_permissions": { | |
"type": "string", | |
"description": "Conjunto de permisos representados como un conjunto de bits." | |
}, | |
"dm_permission": { | |
"type": "boolean", | |
"description": "Indica si el comando está disponible en mensajes directos con la aplicación. Solo para comandos de alcance global. Por defecto, los comandos son visibles.", | |
"default": true | |
}, | |
"nsfw": { | |
"type": "boolean", | |
"description": "Indica si el comando está restringido por edad. Por defecto es falso.", | |
"default": false | |
} | |
}, | |
"required": ["name", "description"], | |
"additionalProperties": false, | |
"definitions": { | |
"option": { | |
"type": "object", | |
"properties": { | |
"type": { | |
"type": "integer", | |
"description": "Tipo de opción. 1 para subcomando, 2 para grupo de subcomandos, 3 para string, 4 para integer, 5 para boolean, 6 para user, 7 para channel, 8 para role, 9 para mentionable.", | |
"enum": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | |
}, | |
"name": { | |
"type": "string", | |
"description": "El nombre de la opción.", | |
"minLength": 1, | |
"maxLength": 32 | |
}, | |
"description": { | |
"type": "string", | |
"description": "La descripción de la opción.", | |
"minLength": 1, | |
"maxLength": 100 | |
}, | |
"required": { | |
"type": "boolean", | |
"description": "Indica si la opción es obligatoria o no." | |
}, | |
"autocomplete": { | |
"type": "boolean", | |
"description": "Si las interacciones de autocompletar están habilitadas para esta opción de tipo STRING, INTEGER o NUMBER." | |
}, | |
"min_value": { | |
"type": "integer", | |
"description": "Valor mínimo permitido para opciones de tipo INTEGER." | |
}, | |
"max_value": { | |
"type": "integer", | |
"description": "Valor máximo permitido para opciones de tipo INTEGER." | |
}, | |
"choices": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"description": "El nombre de la elección.", | |
"minLength": 1, | |
"maxLength": 100 | |
}, | |
"value": { | |
"type": "string", | |
"description": "El valor de la elección.", | |
"minLength": 1, | |
"maxLength": 100 | |
} | |
}, | |
"required": ["name", "value"], | |
"additionalProperties": false | |
}, | |
"description": "Las elecciones para la opción (solo para opciones de tipo STRING, INTEGER o NUMBER)." | |
}, | |
"options": { | |
"type": "array", | |
"items": { "$ref": "#/definitions/option" }, | |
"description": "Las subopciones para la opción." | |
}, | |
"channel_types": { | |
"type": "array", | |
"items": { | |
"type": "integer", | |
"enum": [0, 1, 2, 4, 5, 6] | |
}, | |
"description": "Tipos de canales permitidos para opciones de tipo CHANNEL." | |
} | |
}, | |
"required": ["type", "name", "description"], | |
"additionalProperties": false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment