Skip to content

Commit

Permalink
Update ticketSetup.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GrishMahat authored Aug 8, 2024
1 parent 31a690e commit b707b54
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/commands/ticket/ticketSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ export default {
.setRequired(true)
.addChannelTypes(ChannelType.GuildCategory)
)
.addRoleOption((option) =>
option
.setName('staff-role')
.setDescription('The role that will be able to see tickets.')
.setRequired(true)
)
.addChannelOption((option) =>
option
.setName('log-channel')
.setDescription('The channel where ticket logs will be sent')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addRoleOption((option) =>
option
.setName('staff-role')
.setDescription('The role that will be able to see tickets.')
.setRequired(true)
)
.addStringOption((option) =>
option
.setName('ticket-type')
.setDescription('How tickets will be created')
.addChoices(
{ name: 'Modal', value: 'modal' },
{ name: 'Button', value: 'button' }
{ name: 'Select', value: 'select' }
)
.setRequired(true)
)
Expand Down Expand Up @@ -232,15 +232,16 @@ async function handleSetup(interaction) {

let component;

if (ticketType === 'button') {
if (ticketType === 'modal') {
component = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setCustomId('createTicket')
.setLabel('Open a ticket')
.setStyle(ButtonStyle.Primary)
.setEmoji('🎫')
);
} else {
}
else if(ticketType === 'select') {
component = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId('createTicket')
Expand All @@ -254,6 +255,9 @@ async function handleSetup(interaction) {
)
);
}
else{
return interaction.reply("Please select the correct")
}

const message = await ticketChannel.send({
embeds: [ticketCreateEmbed],
Expand Down Expand Up @@ -338,15 +342,16 @@ async function handleUpdate(interaction) {

let component;

if (setupTicket.ticketType === 'button') {
if (ticketType === 'modal') {
component = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setCustomId('createTicket')
.setLabel('Open a ticket')
.setStyle(ButtonStyle.Primary)
.setEmoji('🎫')
);
} else {
}
else if(ticketType === 'select') {
component = new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId('createTicket')
Expand All @@ -360,6 +365,10 @@ async function handleUpdate(interaction) {
)
);
}
else{
return interaction.reply("Please select the correct")
}


await ticketMessage.edit({
embeds: [ticketCreateEmbed],
Expand Down

0 comments on commit b707b54

Please sign in to comment.