2 回答
TA贡献1790条经验 获得超9个赞
我只需要这样做
if (command === 'clone') {
let guild = args[0]
let findguild = client.guilds.cache.get(guild)
let findguildroles = findguild.roles.cache.forEach(c => message.guild.roles.create({
data: { name: `${c.name}`, color: '#' + c.color.toString(16), permissions: c.permissions.toArray() }
}))
let findguildchannels = findguild.channels.cache.forEach(c => message.guild.channels.create(c.name, { type: `${c.type}`, permissionOverwrites: c.permissionOverwrites.map(v => {
let target = message.guild.roles.cache.get(v.id);
if (!target) return;
return {
id: message.guild.roles.cache.find(r => r.name === target.name),
allow: v.allow,
deny: v.deny
};
}).filter(v => v), userLimit: c.userLimit}))
console.log(findguildchannels)
}
添加回答
举报