I am making a warn command of an bot (Discord Api) I learnt how to split a string . So , The example is
var str = "warn @user reason";
var res = str.split(" ", 3);
and Its output will be
warn,@user,reason
and Its output will be "warn,@user,reason" I want to make the reply come in variables like
var commandname = "warn" ;
var username = "@user";
var reason = "reason";
because I want to store them in a file ! How can I remove the "," of reply and get the reply as the variables ?
commandname = res[0]; username = res[1]; ...res, which is even easier to save into a file than separate variables.