我需要?jiǎng)?chuàng)建一個(gè)命令,首先從所有以星號(hào)開(kāi)頭的角色中刪除該成員,然后分配一個(gè)將在命令參數(shù)中傳遞的角色。exports.run = (client, message, [where]) => { var role = message.guild.roles.cache.find(role => role.name === where); if (role && where.substring(0, 1) == '*') { //remove all roles that start with * from the member, probably some kind of for loop? message.member.roles.add(role); message.channel.send(message.member.nickname + ' entered the channel ' + where + '.'); } else message.channel.send('Channel' + where + ' does not exist or does not start with *.');};你能幫我解決那個(gè)for循環(huán)嗎?謝謝。
Discord.js - 刪除所有以 *(星號(hào))開(kāi)頭的角色
茅侃侃
2022-06-16 10:03:54