How add arguments to slash command?

How add arguments to slash command and read it?
await bot.application.commands.create({name: 'test', description: 'Test command'}).catch(console.error);
await bot.application.commands.create({name: 'test', description: 'Test command'}).catch(console.error);
And
bot.on(Events.InteractionCreate, async (interaction) => { Print arguments... };
bot.on(Events.InteractionCreate, async (interaction) => { Print arguments... };
No description
5 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
vo0ov
vo0ovOP15mo ago
discord.js - 14.13.0 Node.js - v21.1.0
Epicness
Epicness15mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Epicness
Epicness15mo ago
This has all the info you need
vo0ov
vo0ovOP15mo ago
Thank you

Did you find this page helpful?