From bae221056c45c910822e2407b5a9a624e5729913 Mon Sep 17 00:00:00 2001 From: DJj123dj <80536295+DJj123dj@users.noreply.github.com> Date: Tue, 8 Apr 2025 22:01:36 +0200 Subject: [PATCH] Fixed #149 Tickets not changing categories --- src/actions/claimTicket.ts | 2 +- src/actions/closeTicket.ts | 2 +- src/actions/reopenTicket.ts | 2 +- src/actions/unclaimTicket.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/actions/claimTicket.ts b/src/actions/claimTicket.ts index cb82ed4..6729254 100644 --- a/src/actions/claimTicket.ts +++ b/src/actions/claimTicket.ts @@ -26,7 +26,7 @@ export const registerActions = async () => { await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-claimed",user.id,1,"increase") //update category - if (params.allowCategoryChange){ + if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){ const rawClaimCategory = ticket.option.get("opendiscord:channel-categories-claimed").value.find((c) => c.user == user.id) const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null if (claimCategory){ diff --git a/src/actions/closeTicket.ts b/src/actions/closeTicket.ts index c442b86..a37bb7d 100644 --- a/src/actions/closeTicket.ts +++ b/src/actions/closeTicket.ts @@ -28,7 +28,7 @@ export const registerActions = async () => { await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-closed",user.id,1,"increase") //update category - if (params.allowCategoryChange){ + if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){ const closeCategory = ticket.option.get("opendiscord:channel-category-closed").value if (closeCategory !== ""){ try { diff --git a/src/actions/reopenTicket.ts b/src/actions/reopenTicket.ts index d80878c..84e01fb 100644 --- a/src/actions/reopenTicket.ts +++ b/src/actions/reopenTicket.ts @@ -28,7 +28,7 @@ export const registerActions = async () => { await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-reopened",user.id,1,"increase") //update category - if (params.allowCategoryChange){ + if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){ const channelCategory = ticket.option.get("opendiscord:channel-category").value const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value if (channelCategory !== ""){ diff --git a/src/actions/unclaimTicket.ts b/src/actions/unclaimTicket.ts index d9b391c..0d8d8d8 100644 --- a/src/actions/unclaimTicket.ts +++ b/src/actions/unclaimTicket.ts @@ -22,7 +22,7 @@ export const registerActions = async () => { ticket.get("opendiscord:busy").value = true //update category - if (params.allowCategoryChange){ + if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){ const channelCategory = ticket.option.get("opendiscord:channel-category").value const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value if (channelCategory !== ""){