const { SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, Events, ActionRow } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('create') .setDescription('Cria uma ficha de Breed') .addStringOption(option => option.setName('dinoname') .setDescription('Dino que sera breedado, caso queira um dino que não esteja na lista , digite um nome qualquer.') .setRequired(true) .setAutocomplete(true)), async autocomplete(interaction) { const focusedValue = interaction.options.getFocused(); const choices = ['Amargasaurus', 'Andrewsarchus', 'Astro', 'Barionyx', 'Basilisk', 'Basilo', 'Carbo', 'Charca', 'Daeodon', 'Deino', 'Desmodus', 'FjordHawk', 'Giga', 'Griffin', 'LightWyvern', 'Mantis', 'Racer', 'Rex', 'Shadow', 'Snow', 'Stalker', 'Stego', 'Tape', 'Theri', 'Thyla', 'Tuso', 'Velona', 'Voidwyrm', 'Yutirannus'] const filtered = choices.filter(choice => choice.toLowerCase().startsWith(focusedValue.toLowerCase())).slice(0, 25); await interaction.respond( filtered.map(choice => ({ name: choice, value: choice })), ); }, async execute(interaction) { const filter = (interaction) => interaction.customId === 'custom_dino_modal'; interaction.awaitModalSubmit({ filter, time: 15_000 }) .then(interaction => console.log(`${interaction.customId} foi enviado!`)) .catch(console.error); dinoname = interaction.fields.getTextInputValue('customDinonameInput'); dinoimage = interaction.fields.getTextInputValue('customDinonameThumbnail');}, async execute(interaction) { let dinoname = interaction.options.getString('dinoname') let dinoimage = [] const modaldinorow = new ActionRowBuilder() .addComponents( new TextInputBuilder() .setMinLength(1) .setMaxLength(50) .setCustomId('customDinonameInput') .setLabel("Qual o nome do dino que sera breedado?") .setStyle(TextInputStyle.Short), ) const modaldinorow1 = new ActionRowBuilder() .addComponents( new TextInputBuilder() .setMinLength(1) .setMaxLength(1000) .setCustomId('customDinonameThumbnail') .setLabel("URL da imagem de seu dino.") .setStyle(TextInputStyle.Short) ) const custom_dino_modal = new ModalBuilder() .setCustomId('customDinoModal') .setTitle('Sunflower-LineCreator') .addComponents(modaldinorow, modaldinorow1) let criar = new EmbedBuilder() .setColor(0x080000) .setTitle(`${dinoname} Line`) .setDescription(`Selecione os status breedados de ${dinoname}`) .setAuthor({ name: 'Sunflower-LineCreator', iconURL: 'https://i.imgur.com/Qy2XpGi.png' }) .setThumbnail(dinoimage) const statuscriar = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('health') .setLabel('Health') .setStyle(ButtonStyle.Primary) .setEmoji('<:Health:1051354075691745391>'), new ButtonBuilder() .setCustomId('stamina') .setLabel('Stamina') .setStyle(ButtonStyle.Primary) .setEmoji('<:Stamina:1051354118859526236>'), new ButtonBuilder() .setCustomId('melee') .setLabel('Melee') .setStyle(ButtonStyle.Primary) .setEmoji('<:Damage:1051354091529445456>'), new ButtonBuilder() .setCustomId('food') .setLabel('Food') .setStyle(ButtonStyle.Primary) .setEmoji('<:Food:1051354054644740117>'), ) const optionscriar = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('cancell') .setLabel('Cancelar') .setStyle(ButtonStyle.Danger) .setEmoji('⛔'), new ButtonBuilder() .setCustomId('continue') .setLabel('Continuar') .setStyle(ButtonStyle.Success) .setEmoji('✅') ) function createchannelcommand(guildId, embed) { createSchema.findOne({ Guild: guildId }, async (err, data) => { const createChannel = client.forums.cache.get(data.Forum); createChannel.channel.threads.create({ name: `\`${dinoname}\``, reason: `\`${dinoname}\` Line`, }) }); } await interaction.reply( { embeds: [criar], components: [statuscriar, optionscriar], ephemeral: [true] } ) } }