2021年1月23日星期六

I Need to separate 2 texts from a single line array but it don't separate

this is the code:

 const prefix = "&";    const args = msg.content.slice(prefix.length).trim().split(/ +/g);    const cmd = args.shift().toLowerCase();          if(cmd === 'dm') {      if (!client.users.fetch(args.join('').slice(2)))       return console.log("User not found:(");        await (await client.users.fetch(args.join('')))        .send(args.join(''))        .catch(() => { console.log("User has DMs closed or has no mutual servers with the bot or blocked the bot :(");})      }  

what i want is: &dm <user_id> but in console it see: user_id: Value "1761208364761098oi" is not snowflake. ^^ "oi" is the message that i tested to sent.

im using discord.js v12!

https://stackoverflow.com/questions/65865920/i-need-to-separate-2-texts-from-a-single-line-array-but-it-dont-separate January 24, 2021 at 08:13AM

没有评论:

发表评论