mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
more reliable way to find a ticket creator
This commit is contained in:
parent
c16ab0d6a5
commit
92d5ad0e71
2 changed files with 3 additions and 2 deletions
|
@ -112,7 +112,7 @@ class CloseTicket extends BaseCommand {
|
||||||
await interaction.reply({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
await interaction.reply({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
const member = interaction.guild.members.cache.find(u => u.user.username.includes(interaction.channel.name.split("-")[0]));
|
const member = interaction.guild.members.cache.find(u => u.user.id === interaction.channel.topic);
|
||||||
await interaction.channel.permissionOverwrites.edit(member, { ViewChannel: false, SendMessages: null });
|
await interaction.channel.permissionOverwrites.edit(member, { ViewChannel: false, SendMessages: null });
|
||||||
await interaction.channel.setName(`${interaction.channel.name}-closed`);
|
await interaction.channel.setName(`${interaction.channel.name}-closed`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ class CreateTicketEmbed extends BaseCommand {
|
||||||
|
|
||||||
const channel = await interaction.guild.channels.create({
|
const channel = await interaction.guild.channels.create({
|
||||||
name: `${interaction.user.username}-support-${guildData.plugins.tickets.count}`,
|
name: `${interaction.user.username}-support-${guildData.plugins.tickets.count}`,
|
||||||
|
topic: interaction.user.id,
|
||||||
type: ChannelType.GuildText,
|
type: ChannelType.GuildText,
|
||||||
parent: ticketsCategory,
|
parent: ticketsCategory,
|
||||||
permissionOverwrites: [
|
permissionOverwrites: [
|
||||||
|
@ -167,7 +168,7 @@ class CreateTicketEmbed extends BaseCommand {
|
||||||
await interaction.reply({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
await interaction.reply({ content: interaction.translate("misc:CANT_DM"), ephemeral: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
const member = interaction.guild.members.cache.find(u => u.user.username.includes(interaction.channel.name.split("-")[0]));
|
const member = interaction.guild.members.cache.find(u => u.user.id === interaction.channel.topic);
|
||||||
await interaction.channel.permissionOverwrites.edit(member, { ViewChannel: false, SendMessages: null });
|
await interaction.channel.permissionOverwrites.edit(member, { ViewChannel: false, SendMessages: null });
|
||||||
await interaction.channel.setName(`${interaction.channel.name}-closed`);
|
await interaction.channel.setName(`${interaction.channel.name}-closed`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue