是否可以检查用户是否启用了PM? [英] Is it possible to check if user have PM's enabled?

查看:101
本文介绍了是否可以检查用户是否启用了PM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以检查用户是否启用了私人消息。

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

此功能用于支持机器人。当前,我使用GuildMessageRecievedEvent并将私人消息发送给用户。

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

推荐答案

不,没有。您只能发送一条消息并处理失败:

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();
    });

这篇关于是否可以检查用户是否启用了PM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆