diff --git a/commands/fun/a.ts b/commands/fun/a.ts index 213b40a..1ae0308 100644 --- a/commands/fun/a.ts +++ b/commands/fun/a.ts @@ -1,12 +1,32 @@ -import { commandModule, CommandType } from '@sern/handler' -import { Context } from "@sern/handler"; -import { ApplicationCommandOptionType, AttachmentBuilder, AutocompleteInteraction, EmbedBuilder } from "discord.js"; -import { publish } from "#plugins"; -const choices = ['XaviXE', 'Paula', 'William', 'Espejito2500', 'Wheelook', 'MarioCabrera', 'Paticama', 'Vinci', 'SrIzan', 'ItsAdrian', 'ByHGT', 'Irene', 'Boniato64']; +import { commandModule, CommandType } from '@sern/handler'; +import { Context } from '@sern/handler'; +import { + ApplicationCommandOptionType, + AttachmentBuilder, + AutocompleteInteraction, + EmbedBuilder, +} from 'discord.js'; +import { publish } from '#plugins'; +const choices = [ + 'XaviXE', + 'Paula', + 'William', + 'Espejito2500', + 'Wheelook', + 'MarioCabrera', + 'Paticama', + 'Vinci', + 'SrIzan', + 'ItsAdrian', + 'ByHGT', + 'Irene', + 'Boniato64', + 'Tormentarosa', +]; export default commandModule({ name: 'a', - type: CommandType.Slash, + type: CommandType.Slash, plugins: [publish()], description: 'A', //alias : [], @@ -18,49 +38,56 @@ export default commandModule({ autocomplete: true, command: { onEvent: [], - async execute(ctx: AutocompleteInteraction){ + async execute(ctx: AutocompleteInteraction) { const focusedValue = ctx.options.getFocused(); - const filtered = choices.filter(choice => choice.startsWith(focusedValue)); - await ctx.respond( - filtered.map(choice => ({ name: choice, value: choice })), + const filtered = choices.filter((choice) => + choice.startsWith(focusedValue) ); - } - } - } + await ctx.respond( + filtered.map((choice) => ({ name: choice, value: choice })) + ); + }, + }, + }, ], execute: async (ctx, options) => { - let option - try {option = options[1].getString('usuario', true)} catch(error) {option = undefined} - if (!option) { - const imagesArray = [ - './images/a/XaviXE.png', - './images/a/Paula.png', - './images/a/William.png', - './images/a/Espejito2500.png', - './images/a/Wheelook.png', - './images/a/MarioCabrera.png', - './images/a/Paticama.png', - './images/a/Vinci.png', - './images/a/SrIzan.png', - './images/a/ItsAdrian.png', - './images/a/ByHGT.png', - './images/a/Irene.png', - './images/a/Boniato64.png', - ] - const images = imagesArray[Math.floor(Math.random() * imagesArray.length)]; + const option = options[1].getString('usuario'); + if (!option) { + const imagesArray = [ + './images/a/XaviXE.png', + './images/a/Paula.png', + './images/a/William.png', + './images/a/Espejito2500.png', + './images/a/Wheelook.png', + './images/a/MarioCabrera.png', + './images/a/Paticama.png', + './images/a/Vinci.png', + './images/a/SrIzan.png', + './images/a/ItsAdrian.png', + './images/a/ByHGT.png', + './images/a/Irene.png', + './images/a/Boniato64.png', + './images/a/Tormentarosa.png', + ]; + const images = + imagesArray[Math.floor(Math.random() * imagesArray.length)]; - await ctx.reply({content: 'A', files: [images]}); + await ctx.reply({ content: 'A', files: [images] }); + } else { + if (choices.indexOf(options[1].getString('usuario', true)) > -1) { + const attachmentbuilder = new AttachmentBuilder( + `./images/a/${options[1].getString('usuario', true)}.png` + ); + await ctx.reply({ content: 'A', files: [attachmentbuilder] }); } else { - if (choices.indexOf(options[1].getString('usuario', true)) > -1) { - const attachmentbuilder = new AttachmentBuilder(`./images/a/${options[1].getString('usuario', true)}.png`) - await ctx.reply({content: 'A', files: [attachmentbuilder]}) - } else { - const embed = new EmbedBuilder() - .setTitle("A no encontrado!") - .setDescription(`Qué raro, no se ha encontrado ese /a...\nPorqué no pruebas a poner uno del autocompletado?`) - .setColor("Red") - await ctx.reply({embeds: [embed], ephemeral: true}) - } + const embed = new EmbedBuilder() + .setTitle('A no encontrado!') + .setDescription( + `Qué raro, no se ha encontrado ese /a...\nPorqué no pruebas a poner uno del autocompletado?` + ) + .setColor('Red'); + await ctx.reply({ embeds: [embed], ephemeral: true }); } + } }, -}); \ No newline at end of file +}); diff --git a/commands/handlers/mcform.ts b/commands/handlers/mcform.ts index a76f6e1..c10164b 100644 --- a/commands/handlers/mcform.ts +++ b/commands/handlers/mcform.ts @@ -33,7 +33,7 @@ export default commandModule({ .then((res) => res.data); await modal.reply({ content: - 'Enviado!, Gracias por utilizar tu Mona Lisa de confianza\n~Sr Izan, 2022', + 'Enviado!\nSé paciente ya que el bot no es automático.', ephemeral: true, }); const embed = new EmbedBuilder() diff --git a/images/a/Tormentarosa.png b/images/a/Tormentarosa.png new file mode 100644 index 0000000..9b0d355 Binary files /dev/null and b/images/a/Tormentarosa.png differ