[英]Discord.js SyntaxError: Unexpected Identifier (For command handler)
[英]permissionOverwrites syntaxError: Unexpected identifier Discord.js
所以我正在制作一個 Discord.js 票務機器人,我一直卡在 permissionOverwrites 部分,它一直說“permissionOverwrites”是一個意外的標識符,即使我關注了 Discordjs.org。 我的代碼是:
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
您忘記了輸入后的逗號。
type: 'text',
permissionOverwrites: [
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.