From 1e2321313ff14788f9ce2fbf62ee68c3e8598c3d Mon Sep 17 00:00:00 2001 From: DJj123dj <80536295+DJj123dj@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:59:08 +0100 Subject: [PATCH] Implemented "removeParticipantsOnClose" Implemented the option "removeParticipantsOnClose" in the config/general.json. It wasn't implemented in the code by accident. --- src/actions/closeTicket.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/actions/closeTicket.ts b/src/actions/closeTicket.ts index d8374d3..b414851 100644 --- a/src/actions/closeTicket.ts +++ b/src/actions/closeTicket.ts @@ -83,9 +83,15 @@ export const registerActions = async () => { }) }) ticket.get("openticket:participants").value.forEach((participant) => { - //all participants that aren't roles/admins => readonly + //all participants that aren't roles/admins => readonly (OR non-viewable when enabled) if (participant.type == "user"){ - permissions.push({ + if (generalConfig.data.system.removeParticipantsOnClose) permissions.push({ + type:discord.OverwriteType.Member, + id:participant.id, + allow:[], + deny:["SendMessages","AddReactions","AttachFiles","SendPolls","ViewChannel","ReadMessageHistory"] + }) + else permissions.push({ type:discord.OverwriteType.Member, id:participant.id, allow:["ViewChannel","ReadMessageHistory"],