Lumi Doggo
DIAdiscord.js - Imagine an app
•Created by Lumi Doggo on 9/6/2023 in #djs-questions
Slash Command Parsing
Good morning, afternoon, and night to those it applies to. I'm attempting to make a slash command that can take a rather long string that includes Strings, Integers and Booleans, optional or not, and take said data onto a database.
The option that I'm currently using is a
new SlashCommandBuilder()
with a long slew of methods after it to oddly specify said command. I'm wondering if there's a better way to do this...
Node version: 16.13.0
Discord JS: 13.16.06 replies
DIAdiscord.js - Imagine an app
•Created by Lumi Doggo on 11/20/2022 in #djs-questions
How to make a slash command parse multiple arguments?
- Discord.js ver. 13.6.0
- Node.js ver. 16.13.0
I've been wondering if there's a way that I can just have a slash command detect multiple... arguments that it's given, and if the command can have multiple versions.
Say, I have a command called "create", and past the word create, I give it 2 words, then a number, it should detect that the 2 words are "first name" and "last name", but if I give it 3 words, it detects it as "first name", "middle name", and "last name"?
I also ask because I've been using the
"addStringOption"
to the command, making it rather long and tedious for people to write in, as they have to select the option before writing in their option.
The code for the command: https://pastebin.com/7Lamre1V
Code for the command handler, just in case: https://pastebin.com/vCMFAaGj24 replies