Помогите пожалуйста с ролями в discord.js
Как мне с помощью discord.js дать определённую роль всем пользователям у кого нет ролей? Скажите пожалуйста
Ответы (1 шт):
Автор решения: Andrey Freiz
→ Ссылка
let role = message.guild.roles.find(r => r.name == 'Community')
if (!role) return message.channel.send(`**${message.author.username}**, role not found`)
message.guild.members.filter(m => !m.user.bot).forEach(member => member.addRole(role))
message.channel.send(**${message.author.username}**, role **${role.name}** was added to all members)