Is it possible to check if user have PM's enabled?

后端 未结 1 518
误落风尘
误落风尘 2021-01-23 13:08

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 a

相关标签:
1条回答
  • 2021-01-23 13:40

    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();
        });
    
    0 讨论(0)
提交回复
热议问题