【发布时间】:2020-10-28 03:51:36
【问题描述】:
我在 discord.js v12 之后几乎通过 bot 更新了所有内容,但最后一个命令有问题,权限不适用,可能是什么问题?
if(userTickets.has(message.author.id) || message.guild.channels.cache.some(channel => channel.name.toLowerCase() === message.author.username + 's-ticket')) {
message.author.send("EN: You already have a ticket!");
} else {
let guild = message.guild;
message.guild.channels.create("????- " + `${message.author.username}s-ticket`, {
type: 'text',
createOverwrite:[
{
id: message.author.id,
allow: 'VIEW_CHANNEL',
},
{
id: guild.id,
deny: 'VIEW_CHANNEL',
},
{
id: '',
allow: 'VIEW_CHANNEL',
}
]
}).then(ch => {
ch.setParent('');
ch.send("=")
userTickets.set(message.author.id, ch.id);
let sChannel = message.guild.channels.cache.get("=")
sChannel.send("Created " + ch.name + " channel.")
//console.log(userTickets);
console.log(userTickets)
}).catch(err => console.log(err));
}
【问题讨论】:
标签: node.js discord discord.js