Search code examples
javascriptnode.jsdiscord.jsargs

How can I split a specific word from an args NodeJS / discord.js


 let kişi = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
     let sebep = args.join(` `).split(`${kişi}`)

I have this code, I want to split the "kişi" variable from the args(sebep) any idea on how?


Solution

  • In that case it will be better if you make it:

    let sebep = args.join(` `).replace(`${kişi}`, '')
    

    A friendly advice: Please do not use non-english letters in the code.