const { SlashCommandBuilder , ButtonBuilder , ButtonStyle , ActionRowBuilder , EmbedBuilder, messageLink, 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') .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) { let dinoname = interaction.options.getString('dinoname') 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 modal = new ModalBuilder() .setCustomId('customDinoModal') .setTitle('Sunflower-LineCreator') .addComponents(modaldinorow, modaldinorow1); client.on(Events.InteractionCreate, async interaction => { if (!interaction.isModalSubmit()) return; if (interaction.customId === 'modal') { await interaction.reply({ content: 'Dino enviado com sucesso.', ephemeral: true} ); const customDinoName = interaction.fields.getTextInputValue('customDinonameInput'); const customDinoThumbnail = interaction.fields.getTextInputValue('customDinonameThumbnail'); criar.setThumbnail(customDinoThumbnail) dinoname = customDinoName } }); if (dinoname != choices) { await interaction.showModal(modal); }else if (dinoname === 'Giga') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/d/d3/Giganotosaurus.png/revision/latest/scale-to-width-down/50?cb=20160131192038') } else { if (dinoname === 'Stego') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/c/cd/Stegosaurus.png/revision/latest/scale-to-width-down/50?cb=20201107223717') } else { if (dinoname === 'Charca') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/5/52/Carcharodontosaurus.png/48px-Carcharodontosaurus.png') } else { if (dinoname === 'Carbo') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/4/4c/Carbonemys.png/revision/latest/scale-to-width-down/50?cb=20150615111629') } else { if (dinoname === 'Tape') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/e/ec/Tapejara.png/revision/latest/scale-to-width-down/50?cb=20160913042452') } else { if (dinoname === 'Velona') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/0/00/Velonasaur.png/revision/latest/scale-to-width-down/50?cb=20181107174026') } else { if (dinoname === 'Snow') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/4/4b/Snow_Owl.png/revision/latest/scale-to-width-down/50?cb=20181107170156') } else { if (dinoname === 'Barionyx') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/c/c0/Baryonyx.png/revision/latest/scale-to-width-down/50?cb=20150912191622') } else { if (dinoname === 'Tuso') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/3/37/Tusoteuthis.png/revision/latest/scale-to-width-down/50?cb=20150912193044') } else { if (dinoname === 'Desmodus') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/f/f0/Desmodus.png/48px-Desmodus.png ') } else { if (dinoname === 'Shadow') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/e/e8/Shadowmane.png/revision/latest/scale-to-width-down/50?cb=20210429073217') } else { if (dinoname === 'Astro') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/2/25/Astrodelphis.png/revision/latest/scale-to-width-down/50?cb=20210603193058') } else { if (dinoname === 'Theri') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/6/66/Therizinosaur.png/revision/latest/scale-to-width-down/50?cb=20150917004959') } else { if (dinoname === 'Stalker') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/1/1a/Bloodstalker.png/revision/latest/scale-to-width-down/50?cb=20191217183132') } else { if (dinoname === 'Racer') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/e/e1/Paraceratherium.png/revision/latest/scale-to-width-down/50?cb=20150912192755') } else { if (dinoname === 'Rex') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/5/5f/Rex.png/revision/latest/scale-to-width-down/50?cb=20150615111544') } else { if (dinoname === 'Basilo') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/7/73/Basilosaurus.png/revision/latest/scale-to-width-down/50?cb=20170924191136') } else { if (dinoname === 'FjordHawk') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/b/b9/Fjordhawk.png/48px-Fjordhawk.png') } else { if (dinoname === 'Andrewsarchus') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/c/ce/Andrewsarchus.png/48px-Andrewsarchus.png') } else { if (dinoname === 'Amargasaurus') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/9/92/Amargasaurus.png/48px-Amargasaurus.png') } else { if (dinoname === 'Basilisk') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/b/b1/Basilisk.png/revision/latest/scale-to-width-down/50?cb=20171212204808') } else { if (dinoname === 'Griffin') { criar.setThumbnail( 'https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/f/f8/Griffin.png/revision/latest/scale-to-width-down/50?cb=20170622211825') } else { if (dinoname === 'Daeodon') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/5/5f/Daeodon.png/48px-Daeodon.png') } else { if (dinoname === 'Mantis') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/4/48/Mantis.png/48px-Mantis.png') } else { if (dinoname === 'Thyla') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/2/22/Thylacoleo.png/48px-Thylacoleo.png') } else { if (dinoname === 'Voidwyrm') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/4/4c/Voidwyrm.png/48px-Voidwyrm.png') } else { if (dinoname === 'Deino') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/4/4e/Deinonychus.png/48px-Deinonychus.png') } else { if (dinoname === 'Yutirannus') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/b/b8/Yutyrannus.png/48px-Yutyrannus.png') } else { if (dinoname === 'LightWyvern') { criar.setThumbnail( 'https://ark.wiki.gg/images/thumb/c/c1/Wyvern.png/48px-Wyvern.png') } else { criar.setThumbnail('https://static.thenounproject.com/png/3674270-200.png%27') } } } } } } } } } } } } } } } } } } } } } } } } } } } } } 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'}) 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.channels.cache.get(data.Channel); createChannel.channel.threads.create({ name: `\`${dinoname}\``, reason: `\`${dinoname}\` Line`, }) }); } await interaction.reply( {embeds: [criar] , components: [statuscriar, optionscriar] , ephemeral: [true]} ) } }