From f924dd8fcaeca7523289b9aba46b6145c46b42dd Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 5 Sep 2023 11:38:26 -0400 Subject: rename /use to /send, add resetcmd --- commands/add.js | 10 +++++----- commands/preview.js | 2 +- commands/send.js | 16 ++++++++++++++++ commands/use.js | 16 ---------------- 4 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 commands/send.js delete mode 100644 commands/use.js (limited to 'commands') diff --git a/commands/add.js b/commands/add.js index 5d74b6a..0fbdb56 100644 --- a/commands/add.js +++ b/commands/add.js @@ -3,10 +3,10 @@ const { SlashCommandBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('add') - .setDescription('Add a Command') + .setDescription('Add a command') .addStringOption(option => - option.setName('command') - .setDescription('The name of the command `/use THIS`') + option.setName('name') + .setDescription('The name of the command `/send THIS`') .setRequired(true)) .addStringOption(option => option.setName('content') @@ -15,8 +15,8 @@ module.exports = { async execute(interaction) { if (global.data.getList().length <= 25) { - global.data.add(interaction.options.getString('command'),interaction.options.getString('content')); - await interaction.reply('Added `'+interaction.options.getString('command')+'`.'); + global.data.add(interaction.options.getString('name'),interaction.options.getString('content')); + await interaction.reply('Added `'+interaction.options.getString('name')+'`.'); } else { diff --git a/commands/preview.js b/commands/preview.js index 013f650..3ca6780 100644 --- a/commands/preview.js +++ b/commands/preview.js @@ -6,7 +6,7 @@ module.exports = { .setDescription('Only you can see this!') .addStringOption(option => option.setName('command') - .setDescription('Name of the command to display') + .setDescription('Name of the command to preview') .setRequired(true) .addChoices(...global.data.getList()) ), diff --git a/commands/send.js b/commands/send.js new file mode 100644 index 0000000..a339784 --- /dev/null +++ b/commands/send.js @@ -0,0 +1,16 @@ +const { SlashCommandBuilder } = require('discord.js'); + +module.exports = { + data: new SlashCommandBuilder() + .setName('send') + .setDescription('Send a command') + .addStringOption(option => + option.setName('command') + .setDescription('Name of the command to send') + .setRequired(true) + .addChoices(...global.data.getList()) + ), + async execute(interaction) { + await interaction.reply(global.data.get(interaction.options.getString('command'))); + }, +}; \ No newline at end of file diff --git a/commands/use.js b/commands/use.js deleted file mode 100644 index dc9897b..0000000 --- a/commands/use.js +++ /dev/null @@ -1,16 +0,0 @@ -const { SlashCommandBuilder } = require('discord.js'); - -module.exports = { - data: new SlashCommandBuilder() - .setName('use') - .setDescription('Use a Command') - .addStringOption(option => - option.setName('command') - .setDescription('What the bot will send') - .setRequired(true) - .addChoices(...global.data.getList()) - ), - async execute(interaction) { - await interaction.reply(global.data.get(interaction.options.getString('command'))); - }, -}; \ No newline at end of file -- cgit v1.2.3