Skip to content

Ticket Types and Forms

Sayrix edited this page May 20, 2026 · 3 revisions

Ticket types define the categories users can choose when they open a ticket. Examples are general, billing, and report.

Basic Ticket Type

ticketTypes: {
  general: {
    name: "General Support",
    description: "General help and account questions.",
    emoji: "<:ticket:171717171717171717>",
    categoryId: "777777777777777777"
  }
}
Field Required Purpose
name Yes Display name shown in panels and messages.
description No Description shown in select menus.
emoji No Unicode emoji, custom emoji string, or emoji ID.
categoryId Yes Discord category where ticket channels are created.
channelNameTemplate No Per-type channel name override.
message No Per-type welcome message template.
welcomeContent No Extra runtime text appended to the welcome template.
blockedRoleIds No Roles blocked from this specific ticket type.
staffRoleIds No Extra staff roles for this ticket type.
openForm No Modal questions shown before opening the ticket.
close No Per-type close message template overrides.

Staff and Blocked Roles

Global staff roles come from:

tickets.staffRoleIds

Per-type staff roles are added on top:

ticketTypes: {
  billing: {
    staffRoleIds: ["121212121212121212"]
  }
}

Blocked role checks combine global and per-type blocked roles. If a user has any blocked role, they cannot open that ticket type.

Channel Names

Global default:

tickets: {
  channelNameTemplate: "{ticketNumber}-ticket-{username}"
}

Per-type override:

channelNameTemplate: "{ticketNumber}-billing-{username}"

Available tokens:

  • {ticketNumber}
  • {ticketId}
  • {ticketTypeKey}
  • {ticketTypeName}
  • {createdById}
  • {createdByUsername}
  • {userId}
  • {username}

The bot sanitizes generated channel names for Discord.

Welcome Content

welcomeContent is appended to the selected message template.

welcomeContent: "Please include invoice numbers, order IDs, or payment dates."

Available tokens include:

  • {channelId}
  • {claimStatus}
  • {claimerId}
  • {claimerMention}
  • {claimerUsername}
  • {createdById}
  • {createdByMention}
  • {createdByUsername}
  • {reason}
  • {reason1}, {reason2}, up to the number of form questions
  • {ticketId}
  • {ticketNumber}
  • {ticketTypeKey}
  • {ticketTypeName}
  • {userId}
  • {username}

Opening Forms

Use openForm when users should answer questions before the ticket is created.

openForm: {
  title: "Billing Ticket",
  questions: [
    {
      key: "orderNumber",
      label: "Order number",
      placeholder: "Example: INV-12345",
      style: "short",
      required: false,
      maxLength: 100
    },
    {
      key: "issue",
      label: "What is the billing issue?",
      placeholder: "Explain the problem clearly",
      style: "paragraph",
      required: true,
      minLength: 10,
      maxLength: 1000
    }
  ]
}

Discord modals can contain up to 5 text inputs. Ticket-Bot validates this limit.

Question fields:

Field Purpose
key Stable internal ID for the answer.
label Label shown to the user.
placeholder Optional placeholder text.
style short or paragraph. Defaults to short.
required Whether the user must answer. Defaults to true.
minLength Optional minimum answer length.
maxLength Optional maximum answer length.

The stored reason is a formatted list of question labels and answers. Individual answers are also available in templates as {reason1}, {reason2}, and so on.

Per-Type Close Templates

Ticket types can override the global close DM and close channel templates:

close: {
  dmMessage: "tickets/ticket-closed-dm-billing",
  channelMessage: "tickets/ticket-closed-billing"
}

See Custom Messages for template files.

Clone this wiki locally