消息未定义?

时间:2021-03-19 09:46:17

标签: discord

我有一个事件处理程序,但由于 guildCreate 事件它没有工作,我完全废弃了它,我想谁在乎我会在 index.js 中添加事件,没有人会注意到 :D 但是有一个错误,我不知道为什么会发生

client.on("guildCreate", (guild) => {
  let channelToSend;
   
      let role = message.guild.roles.cache.find(role => role.name === 'Muted')

        guild.channels.cache.forEach((channel) => {
            if (channel.type !== "text") {
                channel.updateOverwrite(`${role.id}`, {
                    CONNECT: false
                });
            } else {
                channel.updateOverwrite(`${role.id}`, {
                    SEND_MESSAGES: false
                });
            }
            m.edit(embed)
        });

   if(!channelToSend) return;

   let superembed = new Discord.MessageEmbed()
      .setDescription("Thanks for inviting me! My prefix is xp!\n This server doesn't have a Muted role (cAsE sEnSiTiVe), so the antispam feature won't work!")
    
   let normaembed = new Discord.MessageEmbed()
       .setDesctipion("Thanks for inviting me! My prefix is xp!")
    
    if(!role) {
       channelToSend.send(supermbed)
    } else {
      channelToSend.send(normaembed)
    }
})

我不知道该怎么办?问题出在哪里?

0 个答案:

没有答案