简体   繁体   English

如何获取用户描述和状态?

[英]How to get user description and status?

how to get user description ("About me") and custom status in JDA ?如何在JDA中获取用户描述(“关于我”)和自定义状态?

screenshot截屏

If I understand your question correctly, you can just use getUserByID() .如果我正确理解你的问题,你可以使用getUserByID() Something like this:像这样:

import sx.blah.discord.api.IDiscordClient;
import sx.blah.discord.handle.obj.IUser;

// Initiate your 'client' as an instance of IDiscordClient
IDiscordClient client = ...;

// String userId = "1234567890";  // <- Uncomment this for tests.
// Get the user's profile information by some user ID
IUser user = client.getUserByID(userId);

// And then get the user's description and custom status
String description = user.getDescription();
String customStatus = user.getCustomStatus();

Hope, this will help you.希望对你有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM