提及频道创建频道锁定命令

时间:2020-11-09 17:35:11

标签: javascript discord

  let channels = message.mentions.channels;

  let myChannels = channels.map(channels => new Object({
        'id': channels.id,
        'name': channels.name
    }));
   if(!channels) {
      return message.channel.send("Mencione o canal.")
    }
  const emoji = message.guild.emojis.cache.find(e => e.name === "config")
  const emoji2 = message.guild.emojis.cache.find(e => e.name === "concluido")
  if (!message.member.hasPermission(`MANAGE_CHANNELS`)) return 

    // Realiza as funções depois do comando.
   message.channel.send(`<:${emoji.name}:${emoji.id}>** | Canal bloqueado por ${message.author}**`)
   message.react(`<:${emoji2.name}:${emoji2.id}>`)
   myChannels.overwritePermissions([
  {
     id: channels.id,
     deny: ['SEND_MESSAGES', 'ADD_REACTIONS'],
  },
]);
  }
}

基本上,我想创建一个命令来提及要阻止的通道,但是,使用此代码,会出现一些功能错误,有人可以帮助我吗?

0 个答案:

没有答案