简体   繁体   English

权限覆盖语法错误:意外的标识符 Discord.js

[英]permissionOverwrites syntaxError: Unexpected identifier Discord.js

So I'm making a Discord.js ticket bot, and I keep getting stuck at the permissionOverwrites part, it keeps saying that "permissionOverwrites" is an unexpected identifier, even though I followed Discordjs.org.所以我正在制作一个 Discord.js 票务机器人,我一直卡在 permissionOverwrites 部分,它一直说“permissionOverwrites”是一个意外的标识符,即使我关注了 Discordjs.org。 My code is:我的代码是:

  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`) 
      )
    })
  }

I'm relatively a beginner at JS and Discord.js, and any help would be appreciated, thanks!我相对是 JS 和 Discord.js 的初学者,任何帮助将不胜感激,谢谢!

The error I get is我得到的错误是

/home/runner/ticket-bot/index.js:65
      permissionOverwrites: [
      ^^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected identifier

You forgot the comma after type.您忘记了输入后的逗号。

type: 'text',
permissionOverwrites: [

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM