nodbot/slash-commands/meme.js
Skylar Grant 23c81305a0
All checks were successful
NodBot PE Dockerization / build (push) Successful in 19s
Fix we are not the same
2025-02-09 19:58:52 -05:00

57 lines
1.9 KiB
JavaScript

const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageActionRow, Modal, TextInputComponent } = require('discord.js');
const fn = require('../functions.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('meme')
.setDescription('Generate a meme from a template')
.addStringOption(option =>
option.setName('template')
.setDescription('The meme template')
.setRequired(true)
.addChoices(
{ name: 'Drake Hotline Bling', value: '181913649' },
{ name: 'Anakin & Padme', value: '322841258' },
{ name: 'Y\'all Got Any More...', value: '124055727' },
{ name: 'We Are Not The Same', value: '342785297' },
{ name: 'Surprised Pikachu', value: '155067746' },
{ name: 'Two Buttons', value: '87743020' },
{ name: 'Uno Draw 25', value: '217743513' }
)
),
async execute(interaction) {
try {
const template = interaction.options.getString('template');
// Switch the template
switch (template) {
// One-Field Memes
// Two-Field Memes
case '181913649': // Y'all got any more of that
case '124055727': // Drake Hotline Bling No/Yes
case '217743513': // Uno Draw 25
// Generate a modal with two text inputs
const twoFieldMemeModal = fn.memes.twoFieldModal(template);
await interaction.showModal(twoFieldMemeModal);
break;
// Three-Field Memes
case '322841258': // Anakin & Padme
case '342785297': // We are not the same
case '155067746': // Surprised Pikachu
case '87743020': // Two Buttons
// Generate a modal with three text inputs
const threeFieldMemeModal = fn.memes.threeFieldModal(template);
await interaction.showModal(threeFieldMemeModal);
break;
default:
await interaction.reply('Invalid meme template');
break;
}
} catch (error) {
console.error(error);
await interaction.reply('There was an error while executing this command!');
}
},
};