public async Task ModifyAsync(Action <UserModifyArgs> modifyArgs) { var args = new UserModifyArgs(); modifyArgs(args); await client.ApiClient.ModifySelfAsync(args); }
public ValueTask ModifyAsync(Action <UserModifyArgs> modifyArgs) { var args = new UserModifyArgs(); modifyArgs(args); Username = args.Username; if (args.Avatar != null) { throw new NotImplementedException(); } return(default);
public async ValueTask ModifySelfAsync(UserModifyArgs args) { if (args.Avatar.Type == ImageType.WEBP) { throw new InvalidDataException("Can't upload WEBP images."); } var response = await RestClient.PatchJsonAsync( DiscordApiRoutes.UserMe(), args) .ConfigureAwait(false); HandleErrors(response); }
/// <inheritdoc/> public async Task ModifySelfAsync(UserModifyArgs args) { if (args.Avatar.Type == ImageType.WEBP) { throw new InvalidDataException("Can't upload WEBP images."); } var json = JsonSerializer.Serialize(args, options); var response = await httpClient.PatchAsync( DiscordApiRoutes.UserMe(), json) .ConfigureAwait(false); HandleErrors(response, options); }
public ValueTask ModifySelfAsync(UserModifyArgs args) { throw new NotImplementedException(); }