From 771f42636b976e8c16f4d7833ac3b38198226af5 Mon Sep 17 00:00:00 2001 From: Bloodcloak <59000966+bloodcloak@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:37:41 -0400 Subject: [PATCH] bug fix helper --- helpers/closeRequestEmbed.js | 6 +++++- interactions/buttons/operation/closeRequest.js | 4 ++-- interactions/slash/operation/close.js | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) 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