That args variable is just the way the script catches the args of the command line. You determine that when you build the script, since you are always working around what command syntax the user will have to supply. For the line you quote: args = msg.content.split(/\s/); ... that is going to use a Regex to split on every 'white space' character. That means that a command line like this: !scripthandle Bilbo dragon=1 armor=2 would, in the args object, be an array like this: ["!scripthandle", "Bilbo", "dragon=1", "armor=2"] So, when you see this line: switch(args.shift()) { ...two things are going on, there. First, the shift() function is popping the first element out of the array, and *returning* it at the same time. That means that the switch() structure receives the first element out of args (the api handle, "!scripthandle"), and args is left with ONLY the arguments that followed the handle. Args is now: ["Bilbo", "dragon=1", "armor=2"] So if you need to do further parsing to build other structures, you can. It's up to you what each argument means, what order they come in, and whether the order even matters. If you want to know what dragon Bilbo is facing, you would have to identify the dragon argument (maybe it's the second element after you eliminate the api handle -- args[1] -- or maybe it is the one that begins "dragon="). Once you had it, you could split it on the "=", and use the second half to look up some information about dragon #1. At any time you can join those arguments, so if you *didn't* mean to split them in the first place (you only wanted to get ride of the api handle and keep everything after, you would 1) split on white space, 2) shift() or slice(1) to get rid of the api handle, then 3) join args again using a space. // if msg.content = '!logger This is the message to save' args = msg.content.split(/\s/); // split on white spaces switch(args.shift()) { // remove first element (api handle) from args and use it in switch comparison case '!logger': // catch where it equals !logger let text = n + '<br>' + bulletChar + ' ' + args.join(' '); // rebuild the args into a single string, and add other characters break; } Note: the above method of switching on the api handle would make sense in a script that had multiple api handles to answer. In other words, if you had a "logger" and a "loggerlast" and a "loggersession", you would want to catch any/all of them, and pursue the right code based on what the supplied handle was. For other scripts that have only 1 command path based on the api handle, it's often better to test the handle at the same time that you determine whether the script should catch the api call in the first place. That prevents unnecessary processing/overhead.