Why does my nickname command only accept one word Discord.js?

Depends on how args is constructed once it’s passed into run. I’m assuming it separates the command string based on the spaces (eg. if you type nickname The Person it’ll split it into an array with 3 elements ["nickname", "The", "Person"]. If you don’t have any more important arguments for this command you could just combine the split elements back into one string again.

let nick = "";

args.map((value, index) => {
    if (index !== 0) nick+=value+" ";

Or something like that

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top