Reputation: 31
Hello wonderful internet people
I am writing code to set the status of my bot in discord.js. I am wondering how I can take a user's full args list and put it into one let statement, like saying (args[0] + ' ' + args[1], etc)
Here is my current code
Thank you, hope you have a great day
let statgame = (args[0])
client.user.setActivity(statgame);
Upvotes: 1
Views: 160
Reputation: 96
Not sure if I got you 100%. From what I understood you can achieve this with arguments object MDN
function myargs() { console.log([...arguments].join(' ')) }
Upvotes: 0
Reputation: 86
Given args is an array, JS provides a join function that does this for you
let joinedArgs = args.join(" ");
The first argument is the string that separates each element
Upvotes: 3