diff --git a/helpers/closeRequestEmbed.js b/helpers/closeRequestEmbed.js index cf3028a..db7d21b 100644 --- a/helpers/closeRequestEmbed.js +++ b/helpers/closeRequestEmbed.js @@ -1,7 +1,7 @@ const { ButtonBuilder, ButtonStyle, EmbedBuilder, ActionRowBuilder } = require("discord.js"); const db = require("../../../connectDb"); -export async function closeRequest(interaction) { +async function closeRequestEmbed(interaction) { const channel = interaction.channel; if (!channel.name.startsWith("ticket-")) { @@ -49,4 +49,8 @@ export async function closeRequest(interaction) { if (interaction.user.id !== ticket.user_id) { await interaction.channel.send({ content: `<@${ticket.user_id}>, Please confirm the closing of this ticket.` }) } +} + +module.exports = { + closeRequestEmbed } \ No newline at end of file diff --git a/interactions/buttons/operation/closeRequest.js b/interactions/buttons/operation/closeRequest.js index 7883c36..1e85655 100644 --- a/interactions/buttons/operation/closeRequest.js +++ b/interactions/buttons/operation/closeRequest.js @@ -1,8 +1,8 @@ -import { closeRequest } from "../../../helpers/closeRequestEmbed"; +const closeRequestEmbed = require("closeRequestEmbed"); module.exports = { id: "close_request", async execute(interaction) { - closeRequest(interaction); + closeRequestEmbed(interaction); } } \ No newline at end of file diff --git a/interactions/slash/operation/close.js b/interactions/slash/operation/close.js index ee9bdfc..c0eac16 100644 --- a/interactions/slash/operation/close.js +++ b/interactions/slash/operation/close.js @@ -1,12 +1,12 @@ const { SlashCommandBuilder } = require("discord.js"); -import { closeRequest } from "../../../helpers/closeRequestEmbed"; +const closeRequestEmbed = require("closeRequestEmbed"); module.exports = { data: new SlashCommandBuilder() .setName('close') .setDescription('Close a ticket.'), async execute(interaction) { - closeRequest(interaction); + closeRequestEmbed(interaction); } } \ No newline at end of file