I want send a text to a id, but I don't know what it is. Means, that id is from a user or a channel. With discord.io this was very easy with
client.sendMessage({to: ID, message: 'message text'});
How I can send a message only with a ID with discord.js?
For a ID that is from a user:
console.log(client.channels.find('id', 'a-user-id'));
Result is "null".
console.log(client.users.find('id', 'a-user-id'));
is working.
So I must check first channel and when this is null, I must check users too? Is here a better way?
This is not the place to ask lib questions. Please join the discord server. Also read the docs carefully. You'll notice that everything is explained there!