Discord.js:无法读取未定义的属性“类型”

因此,我尝试制作一个机器人,在本例中为通道create / delete命令,没有任何js知识(对此我非常讨厌),并且运行不正常

这是代码:

}else if (args[0] === "delete") {
      console.log('deleting')
      let ch = message.content.split(`${bot.prefix}vchannel ${args[0]}`).join('')
      let fetchedChannel = message.guild.channels.cache.find(r=>r.name === ch)
      if (fetchedChannel.type === "voice") {
        fetchedChannel.delete()
      message.channel.send(`Голосовой канал ${ch} удален`).then(msg=>msg.delete({timeout:5000}))
      console.log('delete complete')
      }
    }
    }

并且有错误:

(node:5216) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined

I tried to remove ch:

}else if (args[0] === "delete") {
      console.log('deleting')
      let fetchedChannel = message.guild.channels.cache.find(r=>r.name === args[1].join(''))
      if (fetchedChannel.type === "voice") {
        fetchedChannel.delete()
      message.channel.send(`Голосовой канал ${args[1].join('')} удален`).then(msg=>msg.delete({timeout:5000}))
      console.log('delete complete')
      }
    }
    }

但出现其他错误:

TypeError: args[1].join is not a function

试图自己找到解决方案,但我失败了

请帮助,我要疯了。

如果需要更多代码,我可以发送。

另外,我的英语不好,我会犯错,请原谅我