i don‘t know how to do configurable commands in discord.js

83 Views Asked by At

So I recently started creating a new Discord bot using discord.js. I just wanted to make a command to set up reaction roles, but I can‘t figure out how to implement the arguments from discord in the code without writing it in the js file manually. Can anyone please help me? I can‘t really show you an example code, I‘m sorry :D

1

There are 1 best solutions below

1
mmoomocow On BEST ANSWER

assuming you have the default code provided in the guide

if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

you can get the arguments with

firstArgument = args[0]
firstArgument = args[1]