1

I'd like to know if there is a way to check if a User have Private Messages Enabled.

This Feature is for an Support Bot. Currently I use the GuildMessageRecievedEvent and send a Private Message to the User.

Redi
  • 308
  • 1
  • 4
  • 16

1 Answers1

4

No, there is not. You can only send a message and handle the failure:

user.openPrivateChannel().submit()
    .thenCompose(channel -> channel.sendMessage(x).submit())
    .whenComplete((message, error) -> {
        if (error != null) failed();
        else success();
    });
Minn
  • 5,688
  • 2
  • 15
  • 42