Exemple #1
0
        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;
            }
        }
Exemple #2
0
 /// <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();
 }