javascript - 无法读取未定义错误的属性“发送”
问题描述
您好,当我写 &acil 时,我正在尝试从我的不和谐机器人 (Js) 向我的所有朋友发送消息,但是当我编写此命令时出现问题并发送大量消息,有时会给出 => TypeError: Cannot read property 'send ' 未定义的错误
require("dotenv").config();
const fetch = require("node-fetch");
const Discord=require("discord.js");
const client = new Discord.Client();
client.on("message",message =>{
console.log("Gelen mesaj"+message.content);
if(message.content === "&acil")
message.client.users.cache.get('777206236986474526').send('ACİL TOPLANTI!');
message.client.users.cache.get('675607935380094986').send('ACİL TOPLANTI!');
message.client.users.cache.get('777206236986474526').send('ACİL TOPLANTI!');
message.client.users.cache.get('7175607935380094986').send('ACİL TOPLANTI!');
});