0

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 Answers1

0

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]
mmoomocow
  • 1,173
  • 7
  • 27
  • Ok thanks, but how can I save the args in the code to change it with a command again. Like if I want to do a configurable join message? – user13529248 May 13 '20 at 08:13