From e8a7d9670f6e583ff28a90ff76c061d1bd9bbc47 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Tue, 8 Aug 2023 22:22:06 +0500 Subject: [PATCH] maybe? --- commands/Tickets/closeticket.js | 3 ++- commands/Tickets/createticketembed.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/Tickets/closeticket.js b/commands/Tickets/closeticket.js index 4e564c5e..3bf04b17 100644 --- a/commands/Tickets/closeticket.js +++ b/commands/Tickets/closeticket.js @@ -112,7 +112,8 @@ class CloseTicket extends BaseCommand { await interaction.reply({ content: interaction.translate("misc:CANT_DM"), ephemeral: true }); } - await interaction.channel.permissionOverwrites.edit(interaction.member, { ViewChannel: false, SendMessages: null }); + const member = interaction.guild.members.cache.find(u => u.user.username === interaction.channel.name.split("-")[0]); + await interaction.channel.permissionOverwrites.edit(member, { ViewChannel: false, SendMessages: null }); await interaction.channel.setName(`${interaction.channel.name}-closed`); } }); diff --git a/commands/Tickets/createticketembed.js b/commands/Tickets/createticketembed.js index 9aee9a61..79aa9687 100644 --- a/commands/Tickets/createticketembed.js +++ b/commands/Tickets/createticketembed.js @@ -167,7 +167,8 @@ class CreateTicketEmbed extends BaseCommand { await interaction.reply({ content: interaction.translate("misc:CANT_DM"), ephemeral: true }); } - await interaction.channel.permissionOverwrites.edit(interaction.member, { ViewChannel: false, SendMessages: null }); + const member = interaction.guild.members.cache.find(u => u.user.username === interaction.channel.name.split("-")[0]); + await interaction.channel.permissionOverwrites.edit(member, { ViewChannel: false, SendMessages: null }); await interaction.channel.setName(`${interaction.channel.name}-closed`); } });