因此,我正在制作Discord.js票证机器人,但我始终陷在permissionOverwrites部分,即使我遵循Discordjs.org,也一直说“ permissionOverwrites”是意外的标识符。 我的代码是:
if (reaction.message.id == ticketid && reaction.emoji.name == `?`) {
reaction.users.remove(user);
reaction.message.guild.channels.create(`ticket-${user.username}`, {
type: 'text'
permissionOverwrites: [
{
id: user.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"],
},
{
id: reaction.message.guild.roles.everyone
deny: ["VIEW_CHANNEL"],
},
],
}).then(async channel => {
channel.send(`<@${user.id}>`, new Discord.MessageEmbed()
.setTitle(`Ticket`)
.setDescription(`We will be with you shortly! Use p?close to close this ticket!`)
.setColor(`#00ff00`)
)
})
}
我是JS和Discord.js的初学者,感谢您的帮助!
我得到的错误是
/home/runner/ticket-bot/index.js:65
permissionOverwrites: [
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
答案 0 :(得分:1)
键入后您忘记了逗号。
type: 'text',
permissionOverwrites: [