From cdfd551076a333a97b239952f47f9f9d18895c8b Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 16 Sep 2022 10:57:30 +0100 Subject: [PATCH] Added /union commands --- src/slashCommands/general/union.js | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/slashCommands/general/union.js diff --git a/src/slashCommands/general/union.js b/src/slashCommands/general/union.js new file mode 100644 index 0000000..9102805 --- /dev/null +++ b/src/slashCommands/general/union.js @@ -0,0 +1,48 @@ +const { SlashCommandBuilder } = require('@discordjs/builders'); + +module.exports = { + ...new SlashCommandBuilder() + .setName('union') + .setDescription('Output various union links') + .addStringOption((option) => + option + .setName('link') + .setDescription('Specific link') + .addChoices( + { name: 'Events', value: 'events' }, + { name: 'Academic Reps', value: 'reps' }, + { name: 'App', value: 'app' } + ) + ), + + /** + * + * @param {Client} client + * @param {CommandInteraction} interaction + * @param {String[]} args + */ + + run: async (client, interaction) => { + const link = interaction.options.getString('link'); + + if (link == null) { + await interaction.reply('https://hulluniunion.com/'); + } + + if (link == 'events') { + await interaction.reply('https://hulluniunion.com/events'); + } + + if (link == 'reps') { + await interaction.reply( + 'https://hulluniunion.com/change-things/academic-reps' + ); + } + + if (link == 'app') { + await interaction.reply( + 'Apple: https://apps.apple.com/gb/app/students-union/id1549685999\r\nAndroid: https://play.google.com/store/apps/details?id=com.studentsunionapp' + ); + } + }, +};