1
1
// Front facing UX for the ticket system. It is a button menu that allows users to select a ticket type and open a ticket.
2
2
/*---- Dev Only ----*/
3
3
4
- const {
5
- PermissionFlagsBits,
6
- ButtonBuilder,
7
- EmbedBuilder,
8
- ActionRowBuilder,
9
- MessageEmbed,
10
- } = require ( "discord.js" ) ;
11
- const ticketSchema = require ( "../../schemas/ticket" ) ;
12
- const emojis = require ( "../../emojis.json" ) ;
4
+ import { ButtonBuilder , EmbedBuilder , ActionRowBuilder } from "discord.js" ;
5
+ import emojis from "../../emojis.json" assert { type : "json " } ;
13
6
14
- module . exports = {
7
+ export default {
15
8
name : 'ticketlistener' ,
16
9
description : 'Adds the ticket listener to the channel' ,
17
10
devOnly : true ,
18
11
callback : async ( client , interaction ) => {
19
12
await interaction . deferReply ( ) ;
20
-
21
13
const channel = interaction . channel ;
22
14
const ticketEmbed = new EmbedBuilder ( )
23
15
. setColor ( [ 108 , 0 , 18 ] )
@@ -40,37 +32,6 @@ module.exports = {
40
32
. setFooter ( { text : "© Sanctuary Development Team - 2023" } )
41
33
;
42
34
43
- // No longer using a dropdown menu, but keeping this code for future reference
44
- /*
45
- const menu = new StringSelectMenuBuilder()
46
- .setCustomId("Select")
47
- .setMaxValues(1)
48
- .setPlaceholder("Select a topic.")
49
- .addOptions(
50
- new StringSelectMenuOptionBuilder()
51
- .setLabel("Report a User")
52
- .setDescription("Do you need to report a user?")
53
- .setValue("Report a User")
54
- .setEmoji("<:icon_report:1140779824793788486>"),
55
- new StringSelectMenuOptionBuilder()
56
- .setLabel("Technical Support")
57
- .setDescription("Are you having technical difficulties?")
58
- .setValue("Technical Support")
59
- .setEmoji("<:icon_tech2:1140800254141268018>"),
60
- new StringSelectMenuOptionBuilder()
61
- .setLabel("VIP Applications")
62
- .setDescription("Apply for VIP / Content Creator status.")
63
- .setValue("VIP Applications")
64
- .setEmoji("<:icon_vip2:1140799537942900799>"),
65
- new StringSelectMenuOptionBuilder()
66
- .setLabel("General Support")
67
- .setDescription("Have some general questions?")
68
- .setValue("General Support")
69
- .setEmoji("<:icon_general2:1140799531496263700>"),
70
- );
71
- const oldRow = new ActionRowBuilder().addComponents(menu);
72
- */
73
-
74
35
// Create Buttons
75
36
const report_button = new ButtonBuilder ( )
76
37
. setCustomId ( 'report_button' )
@@ -98,7 +59,7 @@ module.exports = {
98
59
. setEmoji ( `${ emojis . generalButtonEmoji } ` )
99
60
. setStyle ( 'Success' ) ;
100
61
101
- // Create Button Row
62
+ // Create Button Rows
102
63
const row1 = new ActionRowBuilder ( )
103
64
. addComponents ( report_button , staff_report_button ) ;
104
65
const row2 = new ActionRowBuilder ( )
@@ -108,7 +69,6 @@ module.exports = {
108
69
109
70
110
71
await interaction . deleteReply ( ) ; // Delete command for cleanliness
111
- //await channel.send({ files: [{attachment: './resources/support.png', name: 'support.png'}] });
112
72
await channel . send ( { embeds : [ ticketEmbed ] , files : [ { attachment : './resources/support.png' , name : 'support.png' } ] , components : [ row1 , row2 , row3 ] } ) ;
113
73
}
114
74
}
0 commit comments