const { role_stuff_id, role_mods_id, role_supports_id } = require("../../settings.json") module.exports = { name: 'ticket', run: async (client, interaction) => { var min = 0; var max = 9999; var count = Math.floor(Math.random() * (max - min + 1)) + min; var author = interaction.author.username; const createChannel = await interaction.guild.channels.create(`${author}${count}`, { type: 'GUILD_TEXT', permissionOverwrites: [{ id: interaction.guild.id, deny: 'VIEW_CHANNEL' }, { id: interaction.author.id, allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }, { id: role_stuff_id, allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }, { id: role_mods_id, allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }, { id: role_supports_id, allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] } ] }) const channel = client.channels.cache.get(createChannel.id); channel.send({ content: '<@&' + author + '>' }); } }