I made a command called callsign, when a user does it, they enter their callsign and the bot is supposed to put their callsign into their nickname, example;
!callsign 004
Then it changes their nickname from the one they had to 004 | nickname, for example;
AshieReflex > after command > 004 | AshieReflex
but what it does, it just returns undefined: 004 | undefined.
Here's my code
var nickname = message.content.split (" ").slice (1).join (" ");
if (message.content.startsWith (prefix + 'callsign')) {
message.member.setNickname (`${nickname} | ${message.author.nickname}`);
}