Beispiel #1
0
 internal void Update(DiscordClientUser user)
 {
     base.Update(user);
     Email                 = user.Email;
     EmailVerified         = user.EmailVerified;
     TwoFactorAuth         = user.TwoFactorAuth;
     ExplicitContentFilter = user.ExplicitContentFilter;
     RegistrationLanguage  = user.RegistrationLanguage;
     _nitro                = user._nitro;
 }
Beispiel #2
0
 internal void Update(DiscordClientUser user)
 {
     base.Update(user);
     Email                 = user.Email;
     EmailVerified         = user.EmailVerified;
     TwoFactorAuth         = user.TwoFactorAuth;
     ExplicitContentFilter = user.ExplicitContentFilter;
     _locale               = user._locale;
     _nitro                = user._nitro;
 }
Beispiel #3
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;
            }
        }