This plugin allows you to create advanced forms with 4 types of questions. You can add unlimited questions to a form. The available types are:
- short text
- paragraph text
- dropdown
- buttons
This README.md explains how to configure these forms using the provided JSON structure. The configuration allows for highly customizable forms, including various question types like text, dropdowns and buttons.
Each form in the configuration file is defined as a JSON object with the following fields:
-
id: A unique identifier for the form.- Example:
"example-form".
- Example:
-
name: The name of the form.- Example:
"Example Form".
- Example:
-
description: A brief description of the form (optional).- Example:
"This is an example form (or leave it empty)".
- Example:
-
color: A hexadecimal color code representing the form's visual theme.- Example:
"#f8ba00".
- Example:
-
responseChannel: The ID of the channel where responses will be sent.- Example:
"1331729987518201916".
- Example:
-
autoSendOptionIds: An array of Open Ticket option IDs where the form will be auto-sent when a user creates a ticket of this type.- Example:
["example-ticket-1", "example-ticket-2"].
- Example:
The questions array defines the form's questions. Each question object includes the following properties:
number: The question's unique number in the form.question: The text of the question.type: Specifies the question type. Supported values are:
"short": Short answer (single line) by a discord modal."paragraph": Paragraph answer (multiple lines) by a discord modal."dropdown": Dropdown menu with multiple options. It lets you select single or multiple answers."button": Button options.
For questions of type
shortorlong:
optional: A boolean indicating if the question is optional (true) or required (false).placeholder: A text placeholder for the response input (optional).maxLength: A number to set the max length size of the response (optional, default 1023).
For questions of type
dropdown:
minAnswerChoices: The minimum number of choices a user must select.maxAnswerChoices: The maximum number of choices a user can select.placeholder: A text placeholder for the response input (optional).choices: An array of dropdown choices. Each choice includes:
name: The name of the choice.emoji: An emoji to display with the choice (optional).description: A description of the choice (optional).
For questions of type
button:
choices: An array of button choices. Each button includes:
name: The name of the button.emoji: An emoji to display with the button (optional).color: The button's color. Supported values:"gray","red","green","blue".
{
"id": "example-form",
"name": "Example Form",
"description": "This is an example form (or leave it empty)",
"color": "#99DD99",
"responsesChannel": "channel id where the responses will be sent",
"OTTicketAutoSend": ["example-ticket", "ticket id"],
"questions": [
{
"number": 1,
"question": "That's an example of short answer question? You can add as many questions as you want.",
"type": "short",
"optional": false,
"placeholder": "Single line response, no paragraphs allowed. (or leave it empty)"
},
{
"number": 2,
"question": "That's an example of paragraph answer question?",
"type": "long",
"optional": false,
"placeholder": "Multiple lines response, paragraphs allowed. (or leave it empty)",
"maxLength": 500
},
{
"number": 4,
"question": "That's an example of multiple options dropdown question?",
"type": "dropdown",
"placeholder": "You can select only one option from the dropdown",
"minAnswerOptions": 1,
"maxAnswerOptions": 1,
"options": [
{
"option": "This is the first option.",
"emoji": "emoji (or leave it empty)",
"description": "description (or leave it empty)"
},
{
"option": "And this is the second option. You can add up to 25 options...",
"emoji": "emoji (or leave it empty)",
"description": "description (or leave it empty)"
}
]
}
]
}- Each form must have a unique
id. - The maximum number of dropdown or button options is 25.
- Use meaningful and concise placeholders to guide users.
- Keep required questions clear to ensure proper response handling.
- A form does not have a question limit. But try to make it as shorter as you can so the user can answer in a short time.
- You can add as many forms as you want.
- The forms will be sent automatically when a user creates a ticket from which the option id is on the
autoSendOptionIdsfield. - You can also send a form using the slash command
/form send <form> <channel>. This command allows sending the form to a text channel or a thread.
By following this structure, you can create robust and flexible forms with the OT plugin.