1

All I'm doing right now is trying to send a dm to myself to see if I can get this working. I've tried:

client.users.cache.get(id).send('hi')
But I'm getting "TypeError: Cannot read properties of undefined (reading 'send')." I suppose this has something to do with myself not being cached, but I'm unsure how to go about caching myself. Does anyone know how to properly do this?
ryguy10712
  • 43
  • 4
  • What is the `id` variable mean here and where do you get it from? Try console logging `id` before using it – Caladan Jul 08 '22 at 15:21

1 Answers1

1

Use UserManager#send(). This will create a dm if needed, then send the message

client.users.send(userId, "content")
MrMythical
  • 8,908
  • 2
  • 17
  • 45