Soviet Pancakes
DIAdiscord.js - Imagine an app
•Created by Soviet Pancakes on 10/21/2023 in #djs-questions
How do I make "different" Slash Command String Options?
I see this happening with NQN, and a few other Discord bots. My bot is a currency bot, that has an item/inventory system. I have a /use command, where you put in the item name and it will "use" the item. I'm trying to make it so that the suggested list in the option menu changes depending on the items each user has.
How would I make this happen?
(P.S, my command system is modular, with a "data" key that has the slashcommandoptions, and an "execute" function that passes the interaction and client)
5 replies
DIAdiscord.js - Imagine an app
•Created by Soviet Pancakes on 10/31/2022 in #djs-questions
How do I use a text input select menu in DJS?
An example would be a search menu. What do I do to show a string input box using MessageSelectMenus with type 3? I've read the docs and have gotten many errors and I don't understand the need for
options
if the user can type whatever they want?34 replies
DIAdiscord.js - Imagine an app
•Created by Soviet Pancakes on 10/17/2022 in #djs-questions
Expecting a string primitive for SlashCommandBuilder
I tried making an embed command using Slash commands and a lot of paramaters(probably not a good idea from the start 😅) and after it gave me a ValidationError asking for a string primitive. It doesn't tell me what it was given or where it happened in my own code, but here is the line it hates and my river of parameters.
data: new SlashCommandBuilder()
.setName("embed")
.setDescription("Writes an embed")
.addStringOption(s=>s.setName("title").setRequired(false))
.addStringOption(s=>s.setName("color").setRequired(false))
.addStringOption(s=>s.setName("description").setRequired(false))
.addStringOption(s=>s.setName("footer").setRequired(false))
.addStringOption(s=>s.setName("image").setRequired(false))
.addStringOption(s=>s.setName("thumbnail").setRequired(false))
.addStringOption(s=>s.setName("timestamp").setRequired(false))
.addStringOption(s=>s.setName("author").setRequired(false))
.addStringOption(s=>s.setName("url").setRequired(false))
.addStringOption(s=>s.setName("video").setRequired(false))
.addStringOption(s=>s.setName("provider").setRequired(false)),
(yes ik its a lot)
commands.push(command.data.toJSON()) <-- index.js line that errored. (command is the object returned from module.exports in my embed script.)
8 replies
DIAdiscord.js - Imagine an app
•Created by Soviet Pancakes on 10/8/2022 in #djs-questions
Can unverified discord bots dm anyone?
I made a test command to dm someone that i @mentioned. It was using slash commands and a user input. My code errored and simply said "cannot DM the user." Why does this happen?
9 replies