i like to save my sended DM to a user in a local variable. How can I do this? I would like to react on that message, but if I use .then() after or before the required .catch()-block, the log says "Cannot send messages to this user", without it, I can send the message..
Thank you!!
Code:
client.users.cache
.get(memb.id)
.send(emb5)
.catch((msb) => {
write("Error");
})
.then((msg) => {
msg.react(one);
});
one is the emoji...
If you are in an async function you can put the message in a variable like this:
const user = await client.users.fetch(mem.id); // Fetching the user
const awaitedMessage = await user.send(emb5); // Send the message to the user
awaitedMessage.react(one); // React the sent message