How to make black & white bot took two arguments?

I wrote the code, which the bot can change the name servers on command.
const shell = module.require('discord.js'); 
const fs = require("fs"); 
module.exports.run = async (robot,message,args) => { 

 if (message.content =="!servername_set ", args[0]){ 
message.guild.setName(args[0]);
 } 

}; 
module.exports.help = { 
name: "servername_set" 
};

When I write in chat "!servername_set Server Server1" - the bot changes the server name only on the Server. I need to be able to change the server name to "Server Server1". Please tell me how to do it.
April 7th 20 at 15:17
1 answer
April 7th 20 at 15:19
Solution
args = message.content.split(' ');
args.shift();
//removed the element 1 (the command itself)
args = args.join(' ');
//now it is a single line
Could you insert this in the code itself? I just don't quite understand how.
I would be very grateful. - shawna_Mosciski commented on April 7th 20 at 15:22
@ocie.Flatley, You have the code in the args array, as I see it, clear lines, where it creates and paste mine, and change the channel name is args[0] just use the args - macy_Bernier commented on April 7th 20 at 15:25
@jayde.Parisi, thank you very much. - shawna_Mosciski commented on April 7th 20 at 15:28

Find more questions by tags BotsDiscordJavaScript