我目前已经尝试使用id为例如693301017365839952的特定用户进行dm。
到目前为止我的代码是
if (message.content === '.dm') {
const user = client.cache.get('693301017365839952');
user.send("This is a test");
}我得到的是TypeError: Cannot read property 'get' of undefined..。
有人有解决这个问题的办法吗?(感谢您的任何帮助。)
发布于 2020-10-18 04:13:56
没有client.cache这样的东西。你要找的是client.users.cache.get().
const user = client.users.cache.get("693301017365839952");
user.send("This is a test").catch(console.error);https://stackoverflow.com/questions/64406725
复制相似问题