discord.js – How to pick random mentioned users?

  bots, discord, discord.js, javascript

I am trying to make system, that will dm mentioned users and author of the message with random message. But I’m stuck on getting all mentioned users from the message.

 const userName = message.author.username;
 const userName1 = message.mentions.users.get(1);
 const userName2 = message.mentions.users.get(2);
 const userName3 = message.mentions.users.get(3);

 const userId = message.author.id;

 message.channel.send(`Test ${userName}nTest1 ${userName1}nTest2 ${userName2}`)

Source: Ask Javascript Questions

LEAVE A COMMENT