diff --git a/config/options.jsonc b/config/options.jsonc index 1948f6e..c1d7bf0 100644 --- a/config/options.jsonc +++ b/config/options.jsonc @@ -51,7 +51,7 @@ "thumbnail":"", //Image URL. Leave empty to disable /* Embed fields. Set to empty list [] to disable. */ "fields":[ - {"name":"Field name","value":"Field value","inline":false} + {"name":"FIELD_NAME","value":"FIELD_VALUE","inline":false} ], "timestamp":false } @@ -63,14 +63,14 @@ "embed":{ "enabled":true, "title":"Question Ticket", //Leave empty to disable - "description":"Thank you for creating a ticket in our server.\nOur support team will assist you as soon as possible. (leave empty to disable)", //Leave empty to disable - "customColor":"#f8ab00 (leave empty to disable)", //Leave empty to use default color + "description":"Thank you for creating a ticket in our server.\nOur support team will assist you as soon as possible.", //Leave empty to disable + "customColor":"#f8ab00", //Leave empty to use default color - "image":"https://www.example.com/image.png (leave empty to disable)", //Image URL. Leave empty to disable - "thumbnail":"https://www.example.com/image.png (leave empty to disable)", //Image URL. Leave empty to disable + "image":"", //Image URL. Leave empty to disable + "thumbnail":"", //Image URL. Leave empty to disable /* Embed fields. Set to empty list [] to disable. */ "fields":[ - {"name":"Field name","value":"Field value","inline":false} + {"name":"FIELD_NAME","value":"FIELD_VALUE","inline":false} ], "timestamp":false }, diff --git a/src/components/modals.ts b/src/components/modals.ts index 93d7c3d..304f572 100644 --- a/src/components/modals.ts +++ b/src/components/modals.ts @@ -114,10 +114,11 @@ export async function registerModalComponents(){ title:question.get("opendiscord:name").value, description:(question.get("opendiscord:description").value) ? question.get("opendiscord:description").value : undefined, }) + const minimumFilesIfRequired = (question.get("opendiscord:required").value) ? 1 : 0 component.setComponent(new api.ODFileUploadComponent(question.id.value,{ customId:question.id.value, required:question.get("opendiscord:required").value, - minAmount:(question.get("opendiscord:limits-enabled").value) ? question.get("opendiscord:limits-min").value : undefined, + minAmount:(question.get("opendiscord:limits-enabled").value) ? Math.max(minimumFilesIfRequired,question.get("opendiscord:limits-min").value) : undefined, maxAmount:(question.get("opendiscord:limits-enabled").value) ? question.get("opendiscord:limits-max").value : undefined, })) modal.addComponent(component,"end") diff --git a/src/data/openticket/panelLoader.ts b/src/data/openticket/panelLoader.ts index 2b9315f..d1a883a 100644 --- a/src/data/openticket/panelLoader.ts +++ b/src/data/openticket/panelLoader.ts @@ -71,11 +71,16 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): { hasWebsite = true ticketOnly = false roleOnly = false - }else if (!dropdownMode && opt instanceof api.ODRoleOption){ + }else if (opt instanceof api.ODRoleOption){ options.push(opt) hasRole = true ticketOnly = false websiteOnly = false + }else if (opt instanceof api.ODSubPanelOption){ + options.push(opt) + ticketOnly = false + websiteOnly = false + roleOnly = false } } }) @@ -130,7 +135,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): { return {name:utilities.emojiTitle(emoji,name),value:description} }else{ - //auto-generated plugin option + //auto-generated option (+ sub-panels) const emoji = opt.get("opendiscord:button-emoji") as api.ODOptionData|null const name = opt.get("opendiscord:name") as api.ODOptionData|null const description = opt.get("opendiscord:description") as api.ODOptionData|null @@ -184,7 +189,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): { else return "**"+utilities.emojiTitle(emoji,name)+"**\n"+description }else{ - //auto-generated plugin option + //auto-generated option (+ sub-panels) const emoji = opt.get("opendiscord:button-emoji") as api.ODOptionData|null const name = opt.get("opendiscord:name") as api.ODOptionData|null const description = opt.get("opendiscord:description") as api.ODOptionData|null