【发布时间】:2019-10-29 09:18:58
【问题描述】:
基本上,我需要从用户所在的当前文本频道中获取权限。我已经获得了频道名称,如果我需要获取应该很容易做到的 ID。
const Discord = require("discord.js");
module.exports.run = async (client, message, args) => {
let currentChannel = message.channel.name;
let category = message.channel.parent;;
message.guild.createChannel(currentChannel).then(mchannel => {
mchannel.setParent(category).then(() => {
message.channel.delete();
});
});
}
module.exports.help = {
name: "a.cleanchannel"
}
// Need the channel permissions to overwrite the new channel's permissions with the old ones
预期的结果是频道应该拥有与旧频道相同的权限。
【问题讨论】:
标签: permissions discord discord.js channel