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, 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) switch (dinoname) { case 'Giga': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/d/d3/Giganotosaurus.png/revision/latest/scale-to-width-down/50?cb=20160131192038'); break; case 'Stego': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/c/cd/Stegosaurus.png/revision/latest/scale-to-width-down/50?cb=20201107223717'); break; case 'Charca': dinoimage = ('https://ark.wiki.gg/images/thumb/5/52/Carcharodontosaurus.png/48px-Carcharodontosaurus.png'); break; case 'Carbo': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/4/4c/Carbonemys.png/revision/latest/scale-to-width-down/50?cb=20150615111629'); break; case 'Tape': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/e/ec/Tapejara.png/revision/latest/scale-to-width-down/50?cb=20160913042452'); break; case 'Velona': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/0/00/Velonasaur.png/revision/latest/scale-to-width-down/50?cb=20181107174026'); break; case 'Snow': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/4/4b/Snow_Owl.png/revision/latest/scale-to-width-down/50?cb=20181107170156'); break; case 'Barionyx': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/c/c0/Baryonyx.png/revision/latest/scale-to-width-down/50?cb=20150912191622'); break; case 'Tuso': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/3/37/Tusoteuthis.png/revision/latest/scale-to-width-down/50?cb=20150912193044'); break; case 'Desmodus': dinoimage = ('https://ark.wiki.gg/images/thumb/f/f0/Desmodus.png/48px-Desmodus.png'); break; case 'Shadow': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/e/e8/Shadowmane.png/revision/latest/scale-to-width-down/50?cb=20210429073217'); break; case 'Astro': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/2/25/Astrodelphis.png/revision/latest/scale-to-width-down/50?cb=20210603193058'); break; case 'Theri': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/6/66/Therizinosaur.png/revision/latest/scale-to-width-down/50?cb=20150917004959'); break; case 'Stalker': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/1/1a/Bloodstalker.png/revision/latest/scale-to-width-down/50?cb=20191217183132'); break; case 'Rex': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/5/5f/Rex.png/revision/latest/scale-to-width-down/50?cb=20150615111544'); break; case 'Basilo': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/7/73/Basilosaurus.png/revision/latest/scale-to-width-down/50?cb=20170924191136'); break; case 'FjordHawk': dinoimage = ('https://ark.wiki.gg/images/thumb/b/b9/Fjordhawk.png/48px-Fjordhawk.png'); break; case 'Andrewsarchus': dinoimage = ('https://ark.wiki.gg/images/thumb/c/ce/Andrewsarchus.png/48px-Andrewsarchus.png'); break; case 'Amargasaurus': dinoimage = ('https://ark.wiki.gg/images/thumb/9/92/Amargasaurus.png/48px-Amargasaurus.png'); break; case 'Basilisk': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/b/b1/Basilisk.png/revision/latest/scale-to-width-down/50?cb=20171212204808'); break; case 'Griffin': dinoimage = ('https://static.wikia.nocookie.net/arksurvivalevolved_gamepedia/images/f/f8/Griffin.png/revision/latest/scale-to-width-down/50?cb=20170622211825'); break; case 'Daeodon': dinoimage = ('https://ark.wiki.gg/images/thumb/5/5f/Daeodon.png/48px-Daeodon.png'); break; case 'Mantis': dinoimage = ('https://ark.wiki.gg/images/thumb/4/48/Mantis.png/48px-Mantis.png'); break; case 'Thyla': dinoimage = ('https://ark.wiki.gg/images/thumb/2/22/Thylacoleo.png/48px-Thylacoleo.png'); break; case 'Voidwyrm': dinoimage = ('https://ark.wiki.gg/images/thumb/4/4c/Voidwyrm.png/48px-Voidwyrm.png'); break; case 'Deino': dinoimage = ('https://ark.wiki.gg/images/thumb/4/4e/Deinonychus.png/48px-Deinonychus.png'); break; case 'Yutirannus': dinoimage = ('https://ark.wiki.gg/images/thumb/b/b8/Yutyrannus.png/48px-Yutyrannus.png'); break; case 'LightWyvern': dinoimage = ('https://ark.wiki.gg/images/thumb/c/c1/Wyvern.png/48px-Wyvern.png'); break; default: await interaction.showModal(modal); } 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.channels.cache.get(data.Channel); createChannel.channel.threads.create({ name: `\`${dinoname}\``, reason: `\`${dinoname}\` Line`, }) }); } await interaction.reply( { embeds: [criar], components: [statuscriar, optionscriar], ephemeral: [true] } ) } }