Fixed #149 Tickets not changing categories
This commit is contained in:
@@ -26,7 +26,7 @@ export const registerActions = async () => {
|
|||||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-claimed",user.id,1,"increase")
|
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-claimed",user.id,1,"increase")
|
||||||
|
|
||||||
//update category
|
//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 rawClaimCategory = ticket.option.get("opendiscord:channel-categories-claimed").value.find((c) => c.user == user.id)
|
||||||
const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
|
const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
|
||||||
if (claimCategory){
|
if (claimCategory){
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const registerActions = async () => {
|
|||||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-closed",user.id,1,"increase")
|
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-closed",user.id,1,"increase")
|
||||||
|
|
||||||
//update category
|
//update category
|
||||||
if (params.allowCategoryChange){
|
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
|
||||||
const closeCategory = ticket.option.get("opendiscord:channel-category-closed").value
|
const closeCategory = ticket.option.get("opendiscord:channel-category-closed").value
|
||||||
if (closeCategory !== ""){
|
if (closeCategory !== ""){
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const registerActions = async () => {
|
|||||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-reopened",user.id,1,"increase")
|
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-reopened",user.id,1,"increase")
|
||||||
|
|
||||||
//update category
|
//update category
|
||||||
if (params.allowCategoryChange){
|
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
|
||||||
const channelCategory = ticket.option.get("opendiscord:channel-category").value
|
const channelCategory = ticket.option.get("opendiscord:channel-category").value
|
||||||
const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value
|
const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value
|
||||||
if (channelCategory !== ""){
|
if (channelCategory !== ""){
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const registerActions = async () => {
|
|||||||
ticket.get("opendiscord:busy").value = true
|
ticket.get("opendiscord:busy").value = true
|
||||||
|
|
||||||
//update category
|
//update category
|
||||||
if (params.allowCategoryChange){
|
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
|
||||||
const channelCategory = ticket.option.get("opendiscord:channel-category").value
|
const channelCategory = ticket.option.get("opendiscord:channel-category").value
|
||||||
const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value
|
const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value
|
||||||
if (channelCategory !== ""){
|
if (channelCategory !== ""){
|
||||||
|
|||||||
Reference in New Issue
Block a user