getUser static method
- int id
Requests the user from Discord's servers
id
is expected to be a valid Discord User ID
Implementation
static Future<User> getUser(int id) async {
Dio dio = Dio(DiscordSessionSettings.getOptions);
var reply = await dio
.get("${DiscordEndpoints.BaseURL}${DiscordEndpoints.Users}/${id}");
return User.fromJson(reply.data as String);
}