nodbot/slash-commands/meme.js
Skylar Grant 28d0cc0446
All checks were successful
NodBot Production Dockerization / build (push) Successful in 22s
Add bell curve generator
2025-02-26 18:33:22 -05:00

89 lines
3.0 KiB
JavaScript

const { SlashCommandBuilder } = require('@discordjs/builders');
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' },
{ name: 'Bell Curve', value: '533936279' },
)),
async execute(interaction) {
try {
const template = interaction.options.getString('template');
let memeModal;
// Switch the template
switch (template) {
// One-Field Memes
// Two-Field Memes
// Drake Hotline Bling
case '181913649':
// Generate a modal with two text inputs
memeModal = fn.memes.twoFieldModal(template, ['Drake No', 'Drake Yes']);
await interaction.showModal(memeModal);
break;
// Y'all Got Any More...
case '124055727':
// Generate a modal with two text inputs
memeModal = fn.memes.twoFieldModal(template, ['Top', 'Bottom Text'], ['Y\'all got any more of ', '']);
await interaction.showModal(memeModal);
break;
// Uno Draw 25
case '217743513':
// Generate a modal with two text inputs
memeModal = fn.memes.twoFieldModal(template, ['<blank> or draw 25', 'Caption Above Person'], ['', 'Me']);
await interaction.showModal(memeModal);
break;
// Three-Field Memes
// Bell Curve
case '533936279':
// Generate a modal with two text inputs
memeModal = fn.memes.threeFieldModal(template, ['Left', 'Middle', 'Right']);
await interaction.showModal(memeModal);
break;
// Anakin & Padme
case '322841258':
// Generate a modal with three text inputs
memeModal = fn.memes.threeFieldModal(template, ['Anakin', 'Padme', 'Padme'], ['', '', 'Right?']);
await interaction.showModal(memeModal);
break;
// We are not the same
case '342785297':
// Generate a modal with three text inputs
memeModal = fn.memes.threeFieldModal(template, ['You...', 'I...', 'We...'], ['', '', 'We are not the same.']);
await interaction.showModal(memeModal);
break;
// Surprised Pikachu
case '155067746':
memeModal = fn.memes.threeFieldModal(template);
await interaction.showModal(memeModal);
break;
// Two Buttons
case '87743020':
// Generate a modal with three text inputs
memeModal = fn.memes.threeFieldModal(template, ['Button 1', 'Button 2', 'Person Caption']);
await interaction.showModal(memeModal);
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!');
}
},
};