File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed
open-ticket/ot-ticket-forms Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ The `questions` array defines the form's questions. Each question object include
4646> For questions of type ` short ` or ` long ` :
4747> - ** ` optional ` ** : A boolean indicating if the question is optional (` true ` ) or required (` false ` ).
4848> - ** ` placeholder ` ** : A text placeholder for the response input (optional).
49+ > - ** ` maxLength ` ** : A number to set the max length size of the response (optional, default 1023).
4950
5051> #### Dropdown-Specific Properties
5152> For questions of type ` dropdown ` :
@@ -86,7 +87,8 @@ The `questions` array defines the form's questions. Each question object include
8687 "question" : " That's an example of paragraph answer question?" ,
8788 "type" : " long" ,
8889 "optional" : false ,
89- "placeholder" : " Multiple lines response, paragraphs allowed. (or leave it empty)"
90+ "placeholder" : " Multiple lines response, paragraphs allowed. (or leave it empty)" ,
91+ "maxLength" : 500
9092 },
9193 {
9294 "number" : 4 ,
@@ -122,4 +124,4 @@ The `questions` array defines the form's questions. Each question object include
1221247 . The forms will be sent automatically when a user creates a ticket from which the option id is on the ` autoSendOptionIds ` field.
1231258 . You can also send a form using the slash command ` /form send <form> <channel> ` .
124126
125- By following this structure, you can create robust and flexible forms with the OT plugin.
127+ By following this structure, you can create robust and flexible forms with the OT plugin.
Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ opendiscord.events.get("onModalBuilderLoad").listen((modals) => {
1919 style :question . type ,
2020 required :! question . optional ,
2121 placeholder :question . placeholder ? question . placeholder : undefined ,
22+ maxLength : question . maxLength ?? 1023 ,
2223 } ) ;
2324 }
2425 } )
2526 )
26- } ) ;
27+ } ) ;
Original file line number Diff line number Diff line change 1414 "question" :" This is an example of a short answer question. You can add as many questions as you want." ,
1515 "type" :" short" ,
1616 "optional" :false ,
17- "placeholder" :" Single line response, no paragraphs allowed. (or leave it empty)"
17+ "placeholder" :" Single line response, no paragraphs allowed. (or leave it empty)" ,
18+ "maxLength" : 50
1819 },
1920 {
2021 "position" :2 ,
8485 "question" :" Question Nr1" ,
8586 "type" :" paragraph" ,
8687 "optional" :false ,
87- "placeholder" :" the placeholder (or leave it empty)"
88+ "placeholder" :" the placeholder (or leave it empty)" ,
89+ "maxLength" : 250
8890 }
8991 ]
9092 }
91- ]
93+ ]
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export interface OTForms_ModalQuestion extends OTForms_Question {
5151 type : "short" | "paragraph" ,
5252 placeholder : string ,
5353 optional : boolean ,
54+ maxLength : number ,
5455}
5556
5657/** ## OTForms_Choice `interface`
@@ -80,4 +81,4 @@ export interface OTForms_DropdownChoice extends OTForms_Choice {
8081 */
8182export class ODJsonConfig_DefaultForms extends api . ODJsonConfig {
8283 declare data : OTForms_Form [ ]
83- }
84+ }
You can’t perform that action at this time.
0 commit comments