(v4.1) Additional autoclose/autodelete features

This commit is contained in:
DJj123dj
2025-11-04 19:53:40 +01:00
parent e55438cc67
commit 4b485adf82
8 changed files with 11 additions and 9 deletions
-1
View File
@@ -278,7 +278,6 @@ export const defaultGeneralStructure = new api.ODCheckerObjectStructure("opendis
{key:"replyOnTicketCreation",checker:new api.ODCheckerBooleanStructure("opendiscord:reply-on-ticket-creation",{cliDisplayName:"Reply On Ticket Creation",cliDisplayDescription:"When enabled, the bot will send an ephemeral reply in the channel of the panel when creating a ticket."})},
{key:"replyOnReactionRole",checker:new api.ODCheckerBooleanStructure("opendiscord:reply-on-reaction-role",{cliDisplayName:"Reply On Reaction Role",cliDisplayDescription:"When enabled, the bot will send an ephemeral reply in the channel of the panel when using a role button."})},
{key:"showPreAutocloseWarning",checker:new api.ODCheckerBooleanStructure("opendiscord:show-pre-autoclose-warning",{cliDisplayName:"Show Pre-Autoclose Warning",cliDisplayDescription:"Show a warning message before the ticket gets autoclosed. This will happen when only 1/4th of the autoclose time remains."})},
{key:"askPriorityOnTicketCreation",checker:new api.ODCheckerBooleanStructure("opendiscord:ask-priority-creation",{cliDisplayName:"Ask Priority On Ticket Creation",cliDisplayDescription:"Ask for the priority of this ticket on ticket creation. This will happen in a dropdown in the ticket message."})},
{key:"removeParticipantsOnClose",checker:new api.ODCheckerBooleanStructure("opendiscord:remove-participants-on-close",{cliDisplayName:"Remove Participants On Close",cliDisplayDescription:"When enabled, all participants except admins will be removed from the ticket."})},
{key:"disableAutocloseAfterReopen",checker:new api.ODCheckerBooleanStructure("opendiscord:disable-autoclose-reopen",{cliDisplayName:"Disable Autoclose On Reopen",cliDisplayDescription:"Disable autoclose for a ticket when it has been closed and re-opened."})},
+5 -2
View File
@@ -446,7 +446,9 @@ const loadAutoCode = () => {
if (lastMessage){
//ticket has last message
const disableOnClaim = ticket.option.get("opendiscord:autodelete-disable-claim").value && ticket.get("opendiscord:claimed").value
const enabled = (disableOnClaim) ? false : ticket.get("opendiscord:autodelete-enabled").value
const disableWhenNotClosed = generalConfig.data.system.autodeleteRequiresClosedTicket && !ticket.get("opendiscord:closed").value
const enabled = (disableOnClaim || disableWhenNotClosed) ? false : ticket.get("opendiscord:autodelete-enabled").value
const days = ticket.get("opendiscord:autodelete-days").value
const time = days*24*60*60*1000 //days in milliseconds
@@ -475,7 +477,8 @@ const loadAutoCode = () => {
if (!channel) return
//ticket has been created by this user
const disableOnClaim = ticket.option.get("opendiscord:autodelete-disable-claim").value && ticket.get("opendiscord:claimed").value
const enabled = (disableOnClaim || !ticket.get("opendiscord:autodelete-enabled").value) ? false : ticket.option.get("opendiscord:autodelete-enable-leave")
const disableWhenNotClosed = generalConfig.data.system.autodeleteRequiresClosedTicket && !ticket.get("opendiscord:closed").value
const enabled = (disableOnClaim || disableWhenNotClosed || !ticket.get("opendiscord:autodelete-enabled").value) ? false : ticket.option.get("opendiscord:autodelete-enable-leave")
if (enabled){
//autodelete ticket
-1
View File
@@ -74,7 +74,6 @@ export const defaultGeneralFormatter = new fjs.ObjectFormatter(null,true,[
new fjs.TextFormatter(""),
new fjs.PropertyFormatter("replyOnTicketCreation"),
new fjs.PropertyFormatter("replyOnReactionRole"),
new fjs.PropertyFormatter("showPreAutocloseWarning"),
new fjs.PropertyFormatter("askPriorityOnTicketCreation"),
new fjs.PropertyFormatter("removeParticipantsOnClose"),
new fjs.PropertyFormatter("disableAutocloseAfterReopen"),