Skip to content

Commit

Permalink
Implemented "removeParticipantsOnClose"
Browse files Browse the repository at this point in the history
Implemented the option "removeParticipantsOnClose" in the config/general.json. It wasn't implemented in the code by accident.
  • Loading branch information
DJj123dj committed Dec 6, 2024
1 parent 91ea12a commit 1e23213
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/actions/closeTicket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 1e23213

Please sign in to comment.