[英]Cannot read properties of undefined (reading 'users') | interaction.client.api.users | Discord.js V14
TypeError: Cannot read properties of undefined (reading 'users')
at Object.execute (D:\Mortal\Belgeler\Kod Denemeleri\Discord Botu\Via\v4 (v14)\commands\Kullanıcı\profil.js:34:55)
at module.exports (D:\Mortal\Belgeler\Kod Denemeleri\Discord Botu\Via\v4 (v14)\events\interactionCreate.js:28:21)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
const APIFetch = await interaction.client.api.users(user ? user.id : interaction.user.id).get()
I could not find the solution to the problem on the internet because it is a new version.我在互联网上找不到问题的解决方案,因为它是一个新版本。 I researched for about 2 hours;
我研究了大约2个小时; At first, I looked at the sites and then looked at what data I could pull through interaction or the customer.
起初,我查看了网站,然后查看了我可以通过交互或客户获取哪些数据。 We can't pull API data.
我们无法提取 API 数据。 That's why we get the error "users" can't be read.
这就是为什么我们得到错误“用户”无法读取的原因。 At least that's it, as I understand it... How do I resolve this error?
至少就是这样,据我所知......我该如何解决这个错误?
直接使用interaction.client.users:
const data = await interaction.client.users.fetch(user ? user.id : interaction.user.id);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.