public async Task ChangeProfileAsync(UserProfileUpdate settings) { if (settings.Email == null) { settings.Email = Email; } if (!settings.DiscriminatorProperty.Set) { settings.Discriminator = Discriminator; } if (settings.Username == null) { settings.Username = Username; } DiscordClientUser user = (await Client.HttpClient.PatchAsync("/users/@me", settings)).Deserialize <DiscordClientUser>(); Update(user); if (user.Token != null) { Client.Token = user.Token; } }
/// <summary> /// Changes the user's profile /// </summary> /// <param name="settings">Options for changing the profile</param> public void ChangeProfile(UserProfileUpdate settings) { ChangeProfileAsync(settings).GetAwaiter().GetResult(); }