我已经完成了我的bot。当我尝试运行一个命令,如/play (LINK),它卡住了思考。片刻之后,bot将在控制台中返回此错误并停止运行:
TypeError: Cannot read properties of undefined (reading 'voice')
at Object.run (/home/runner/Comusity-Bot/slash/play.js:29:66)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
repl process died unexpectedly: exit status 1
代码:
const queue = await client.player.createQueue(interaction.guild)
if (!queue.connection) await queue.connect(interaction.memeber.voice.channel)
Repl。: https://replit.com/@TylerLanier Comusity-Bot #斜杠/play.js: 29:66
正如别人指出的,你有一个错别字。您搜索的是memeber
,而应该是member
。