diff --git a/src/autocomplete/references.js b/src/autocomplete/references.js index 300371e..2c59df4 100644 --- a/src/autocomplete/references.js +++ b/src/autocomplete/references.js @@ -23,4 +23,4 @@ module.exports = class ReferencesCompleter extends Autocompleter { }), ); } -}; \ No newline at end of file +}; diff --git a/src/autocomplete/tag.js b/src/autocomplete/tag.js index 90dcef6..c1d8d1b 100644 --- a/src/autocomplete/tag.js +++ b/src/autocomplete/tag.js @@ -47,4 +47,4 @@ module.exports = class TagCompleter extends Autocompleter { })), ); } -}; \ No newline at end of file +}; diff --git a/src/buttons/claim.js b/src/buttons/claim.js index c57e5df..be8a82b 100644 --- a/src/buttons/claim.js +++ b/src/buttons/claim.js @@ -16,7 +16,6 @@ module.exports = class ClaimButton extends Button { /** @type {import("client")} */ const client = this.client; - await interaction.deferReply({ ephemeral: false }); await client.tickets.claim(interaction); } -}; \ No newline at end of file +}; diff --git a/src/buttons/unclaim.js b/src/buttons/unclaim.js index e6c7f4e..ce24603 100644 --- a/src/buttons/unclaim.js +++ b/src/buttons/unclaim.js @@ -16,7 +16,6 @@ module.exports = class UnclaimButton extends Button { /** @type {import("client")} */ const client = this.client; - await interaction.deferReply({ ephemeral: false }); await client.tickets.release(interaction); } -}; \ No newline at end of file +}; diff --git a/src/commands/message/pin.js b/src/commands/message/pin.js index be09d7e..950b221 100644 --- a/src/commands/message/pin.js +++ b/src/commands/message/pin.js @@ -72,4 +72,4 @@ module.exports = class PinMessageCommand extends MessageCommand { ], }); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/add.js b/src/commands/slash/add.js index b8a54bf..544bdbe 100644 --- a/src/commands/slash/add.js +++ b/src/commands/slash/add.js @@ -141,4 +141,4 @@ module.exports = class AddSlashCommand extends SlashCommand { }); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/claim.js b/src/commands/slash/claim.js index 0e457fa..9573250 100644 --- a/src/commands/slash/claim.js +++ b/src/commands/slash/claim.js @@ -23,4 +23,4 @@ module.exports = class ClaimSlashCommand extends SlashCommand { await interaction.deferReply({ ephemeral: false }); await client.tickets.claim(interaction); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/close.js b/src/commands/slash/close.js index af0010b..caccc9a 100644 --- a/src/commands/slash/close.js +++ b/src/commands/slash/close.js @@ -34,4 +34,4 @@ module.exports = class CloseSlashCommand extends SlashCommand { const client = this.client; await client.tickets.beforeRequestClose(interaction); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/help.js b/src/commands/slash/help.js index 2d5f13a..76c7c36 100644 --- a/src/commands/slash/help.js +++ b/src/commands/slash/help.js @@ -76,4 +76,4 @@ module.exports = class ClaimSlashCommand extends SlashCommand { ], }); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/new.js b/src/commands/slash/new.js index 6fad360..2a584bb 100644 --- a/src/commands/slash/new.js +++ b/src/commands/slash/new.js @@ -35,4 +35,4 @@ module.exports = class NewSlashCommand extends SlashCommand { async run(interaction) { await useGuild(this.client, interaction, { referencesTicketId: interaction.options.getString('references', false) }); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/release.js b/src/commands/slash/release.js index b9430c7..497c526 100644 --- a/src/commands/slash/release.js +++ b/src/commands/slash/release.js @@ -23,4 +23,4 @@ module.exports = class ReleaseSlashCommand extends SlashCommand { await interaction.deferReply({ ephemeral: false }); await client.tickets.release(interaction); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/remove.js b/src/commands/slash/remove.js index a78ab0c..427554a 100644 --- a/src/commands/slash/remove.js +++ b/src/commands/slash/remove.js @@ -140,4 +140,4 @@ module.exports = class RemoveSlashCommand extends SlashCommand { userId: interaction.user.id, }); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/tag.js b/src/commands/slash/tag.js index 4eea3b5..7503869 100644 --- a/src/commands/slash/tag.js +++ b/src/commands/slash/tag.js @@ -57,4 +57,4 @@ module.exports = class TagSlashCommand extends SlashCommand { ], }); } -}; \ No newline at end of file +}; diff --git a/src/commands/slash/topic.js b/src/commands/slash/topic.js index eed8da8..9c5b331 100644 --- a/src/commands/slash/topic.js +++ b/src/commands/slash/topic.js @@ -81,4 +81,4 @@ module.exports = class TopicSlashCommand extends SlashCommand { ), ); } -}; \ No newline at end of file +}; diff --git a/src/lib/tickets/manager.js b/src/lib/tickets/manager.js index c5f896e..fe02f33 100644 --- a/src/lib/tickets/manager.js +++ b/src/lib/tickets/manager.js @@ -778,7 +778,7 @@ module.exports = class TicketManager { const getMessage = this.client.i18n.getLocale(ticket.guild.locale); if (!(await isStaff(interaction.guild, interaction.user.id))) { // if user is not staff - return await interaction.editReply({ + return await interaction.reply({ embeds: [ new ExtendedEmbedBuilder({ iconURL: interaction.guild.iconURL(), @@ -788,9 +788,12 @@ module.exports = class TicketManager { .setTitle(getMessage('commands.slash.claim.not_staff.title')) .setDescription(getMessage('commands.slash.claim.not_staff.description')), ], + ephemeral: true, }); } + await interaction.deferReply({ ephemeral: false }); + await Promise.all([ interaction.channel.permissionOverwrites.edit(interaction.user, { 'ViewChannel': true }, `Ticket claimed by ${interaction.user.tag}`), ...ticket.category.staffRoles.map(role => interaction.channel.permissionOverwrites.edit(role, { 'ViewChannel': false }, `Ticket claimed by ${interaction.user.tag}`)), @@ -878,7 +881,7 @@ module.exports = class TicketManager { const getMessage = this.client.i18n.getLocale(ticket.guild.locale); if (!(await isStaff(interaction.guild, interaction.user.id))) { // if user is not staff - return await interaction.editReply({ + return await interaction.reply({ embeds: [ new ExtendedEmbedBuilder({ iconURL: interaction.guild.iconURL(), @@ -888,9 +891,12 @@ module.exports = class TicketManager { .setTitle(getMessage('commands.slash.claim.not_staff.title')) .setDescription(getMessage('commands.slash.claim.not_staff.description')), ], + ephemeral: true, }); } + await interaction.deferReply({ ephemeral: false }); + await Promise.all([ interaction.channel.permissionOverwrites.delete(interaction.user, `Ticket released by ${interaction.user.tag}`), ...ticket.category.staffRoles.map(role => interaction.channel.permissionOverwrites.edit(role, { 'ViewChannel': true }, `Ticket released by ${interaction.user.tag}`)),