Skip to content

Commit

Permalink
bug fix helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodcloak committed Jun 8, 2024
1 parent ffb53a0 commit 771f426
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion helpers/closeRequestEmbed.js
Original file line number Diff line number Diff line change
@@ -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-")) {
Expand Down Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions interactions/buttons/operation/closeRequest.js
Original file line number Diff line number Diff line change
@@ -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);
}
}
4 changes: 2 additions & 2 deletions interactions/slash/operation/close.js
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 771f426

Please sign in to comment.