diff --git a/plugins/tickets/src/discord/components/Template/ButtonConfig.ts b/plugins/tickets/src/discord/components/Template/ButtonConfig.ts new file mode 100644 index 00000000..974ef654 --- /dev/null +++ b/plugins/tickets/src/discord/components/Template/ButtonConfig.ts @@ -0,0 +1,15 @@ +import { TemplateBuilder } from "@/class/TemplateBuilder.js"; +import { Component } from "@/discord/base/index.js"; + +new Component({ + customId: 'Config', + type: "Button", + async run(interaction) { + await interaction.deferReply({ ephemeral: true }) + await new TemplateBuilder({ interaction }) + .setMode('debug') + .edit({ messageId: interaction.message.id }) + + if (interaction.deferred && !interaction.replied) await interaction.deleteReply() + } +}) \ No newline at end of file diff --git a/plugins/tickets/src/discord/components/Template/ButtonActions.ts b/plugins/tickets/src/discord/components/Template/ButtonDelete.ts similarity index 68% rename from plugins/tickets/src/discord/components/Template/ButtonActions.ts rename to plugins/tickets/src/discord/components/Template/ButtonDelete.ts index 54af6ee6..cc5fb7f1 100644 --- a/plugins/tickets/src/discord/components/Template/ButtonActions.ts +++ b/plugins/tickets/src/discord/components/Template/ButtonDelete.ts @@ -3,32 +3,6 @@ import { Component } from "@/discord/base/index.js"; import { ActionDrawer } from "@/functions/actionDrawer.js"; import { ButtonBuilder, ButtonStyle, ComponentType, EmbedBuilder } from "discord.js"; -new Component({ - customId: 'Save', - type: "Button", - async run(interaction) { - await interaction.deferReply({ ephemeral: true }) - await new TemplateBuilder({ interaction }) - .setMode('production') - .edit({ messageId: interaction.message.id }) - - if (!interaction.replied) await interaction.deleteReply() - } -}) - -new Component({ - customId: 'Config', - type: "Button", - async run(interaction) { - await interaction.deferReply({ ephemeral: true }) - await new TemplateBuilder({ interaction }) - .setMode('debug') - .edit({ messageId: interaction.message.id }) - - if (interaction.deferred && !interaction.replied) await interaction.deleteReply() - } -}) - new Component({ customId: 'DeleteTemplate', type: "Button", diff --git a/plugins/tickets/src/discord/components/Template/OpenTicket.ts b/plugins/tickets/src/discord/components/Template/ButtonOpen.ts similarity index 100% rename from plugins/tickets/src/discord/components/Template/OpenTicket.ts rename to plugins/tickets/src/discord/components/Template/ButtonOpen.ts diff --git a/plugins/tickets/src/discord/components/Template/ButtonSave.ts b/plugins/tickets/src/discord/components/Template/ButtonSave.ts new file mode 100644 index 00000000..de00681b --- /dev/null +++ b/plugins/tickets/src/discord/components/Template/ButtonSave.ts @@ -0,0 +1,15 @@ +import { TemplateBuilder } from "@/class/TemplateBuilder.js"; +import { Component } from "@/discord/base/index.js"; + +new Component({ + customId: 'Save', + type: "Button", + async run(interaction) { + await interaction.deferReply({ ephemeral: true }) + await new TemplateBuilder({ interaction }) + .setMode('production') + .edit({ messageId: interaction.message.id }) + + if (!interaction.replied) await interaction.deleteReply() + } +}) \ No newline at end of file diff --git a/plugins/tickets/src/discord/components/Template/setSystem.ts b/plugins/tickets/src/discord/components/Template/ButtonsSetSystem.ts similarity index 100% rename from plugins/tickets/src/discord/components/Template/setSystem.ts rename to plugins/tickets/src/discord/components/Template/ButtonsSetSystem.ts diff --git a/plugins/tickets/src/discord/components/Template/EditActions.ts b/plugins/tickets/src/discord/components/Template/EditTicket.ts similarity index 100% rename from plugins/tickets/src/discord/components/Template/EditActions.ts rename to plugins/tickets/src/discord/components/Template/EditTicket.ts