JaBa/commands/Tickets/openTicketChannel.js
Jonny_Bro (Nikita) aaa0d01c54 some tickets stuff
2023-07-07 17:34:23 +05:00

32 lines
No EOL
1.1 KiB
JavaScript

const { SlashCommandBuilder, EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, PermissionFlagsBits } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('openticketchannel')
.setDescription('Creates an embed with buttons to open a ticket')
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild),
async execute(interaction) {
// create embed for ticket
const embed = new EmbedBuilder()
.setTitle('Tickets')
.setDescription('Open a ticket by choosing a category below');
// add button for support and application
const supportButton = new ButtonBuilder()
.setCustomId('support')
.setLabel('Support')
.setStyle(ButtonStyle.Primary);
const applicationButton = new ButtonBuilder()
.setCustomId('application')
.setLabel('Application')
.setStyle(ButtonStyle.Primary);
const row = new ActionRowBuilder()
.addComponents(supportButton, applicationButton);
// send message with buttons
await interaction.channel.send({ embeds: [embed], components: [row] });
await interaction.reply('Done');
},
};