darthvader1925
darthvader1925

Reputation: 261

How can I console.log the 2nd part of the message after the command

Im making a command called -note, which would send a note to console for me to look at. I can't seem to figure out how to split the 2nd part after the command and then log it to console. Thanks

Upvotes: 0

Views: 31

Answers (1)

Jannik Schmidtke
Jannik Schmidtke

Reputation: 1247

This is very easy:

let msg = message.content.split(" ").slice(1).join(" ");
console.log(msg);

Upvotes: 1

Related Questions