For a server of mine, I need my bot to DM everyone at regular periods of time. I use
client.users.cache.get(args[1]).send(toSend);
to do this, where args[1]
contains the user's id and toSend
is the message to send. However, it just turns up Cannot read property 'send' of undefined
. Then I tried logging client.users.cache
to the console and it appears that only 2 users are in it, the bot itself and me. Why is this so, given that the server has at least 30 users?