Ir al contenido

Formulario de tickets

Un sistema de soporte en tres pasos: un mensaje con botón, un modal con el formulario y un resumen del ticket.

  1. El panel. Un mensaje fijo en el canal de soporte:

    Vista previa
    Mi BotAPPHoy a las 12:00

    🎫 Soporte

    ¿Tienes un problema? Abre un ticket y te ayudaremos.

    payload.json
    {
    "flags": 32768,
    "components": [
    {
    "type": 17,
    "accent_color": 5793266,
    "components": [
    {
    "type": 9,
    "components": [
    {
    "type": 10,
    "content": "## 🎫 Soporte\n¿Tienes un problema? Abre un ticket y te ayudaremos."
    }
    ],
    "accessory": {
    "type": 2,
    "style": 1,
    "label": "Abrir ticket",
    "custom_id": "abrir_ticket"
    }
    }
    ]
    }
    ]
    }
  2. El modal. Al pulsar el botón, el bot responde con este modal:

    Vista previa
    Nuevo ticket
    Categoría*
    Elige una categoría
    Describe el problema*
    Capturas (opcional)
    Arrastra archivos o haz clic para subir
    modal.json
    {
    "type": 9,
    "data": {
    "custom_id": "ticket_modal",
    "title": "Nuevo ticket",
    "components": [
    {
    "type": 18,
    "label": "Categoría",
    "component": {
    "type": 3,
    "custom_id": "categoria",
    "placeholder": "Elige una categoría",
    "options": [
    {
    "label": "Problema técnico",
    "value": "tecnico",
    "emoji": {
    "name": "🛠️"
    }
    },
    {
    "label": "Reportar usuario",
    "value": "reporte",
    "emoji": {
    "name": "🚨"
    }
    },
    {
    "label": "Otra cosa",
    "value": "otro",
    "emoji": {
    "name": "💬"
    }
    }
    ]
    }
    },
    {
    "type": 18,
    "label": "Describe el problema",
    "component": {
    "type": 4,
    "custom_id": "descripcion",
    "style": 2,
    "min_length": 20,
    "max_length": 1500
    }
    },
    {
    "type": 18,
    "label": "Capturas (opcional)",
    "component": {
    "type": 19,
    "custom_id": "capturas",
    "required": false,
    "min_values": 0,
    "max_values": 3
    }
    }
    ]
    }
    }
  3. El resumen. Al enviar el modal, el bot crea el ticket y responde con un resumen:

    Vista previa
    Mi BotAPPHoy a las 12:00

    Ticket #0042 · 🛠️ Problema técnico

    Abierto por @usuario 2026-11-02


    El bot no responde al comando /perfil desde ayer.
    payload.json
    {
    "flags": 32768,
    "components": [
    {
    "type": 17,
    "accent_color": 16705372,
    "components": [
    {
    "type": 10,
    "content": "## Ticket #0042 · 🛠️ Problema técnico"
    },
    {
    "type": 10,
    "content": "-# Abierto por <@123456789012345678> <t:1793620800:R>"
    },
    {
    "type": 14
    },
    {
    "type": 10,
    "content": "> El bot no responde al comando /perfil desde ayer."
    },
    {
    "type": 1,
    "components": [
    {
    "type": 2,
    "style": 3,
    "label": "Atender",
    "custom_id": "ticket_atender:42"
    },
    {
    "type": 2,
    "style": 4,
    "label": "Cerrar",
    "custom_id": "ticket_cerrar:42"
    }
    ]
    }
    ]
    }
    ]
    }
  1. Al recibir custom_id: "abrir_ticket" responde con el JSON del modal (type: 9).
  2. Al recibir el MODAL_SUBMIT con custom_id: "ticket_modal", lee los valores y responde con type: 4 y el resumen.