我想覆盖频道权限。但是我不知道怎么 我试图通过反应来提供支持。我还想覆盖所有人,用户和称为“ Anastic | Staff”的Staff角色的channelpermissinos
这是我的代码:
bot.on("messageReactionAdd", async (reaction, user) => {
if(user.bot) return;
if (reaction.message.partial) await reaction.message.fetch();
if (reaction.partial) await reaction.fetch();
if (user.bot) return;
if (!reaction.message.guild) return;
if (reaction.message.guild.id !== "601109434197868574") return;
if (reaction.emoji.name === "?") {
let channel = await reaction.message.guild.channels.create(
`ticket-${user.username}-#${user.discriminator}`
)
reaction.message.guild.channels.cache.find('name', `ticket-${user.username}-#${user.discriminator}`)
.overwritePermissions(user, {
VIEW_CHANNEL: true,
SEND_MESSAGES: true,
READ_MESSAGE_HISTORY: true,
ATTACH_FILES: false
});
channel = await channel.setParent('731947024932667432');
}