> For the complete documentation index, see [llms.txt](https://degreetpro.gitbook.io/nestgram/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://degreetpro.gitbook.io/nestgram/api-reference/save-user-profile-photo.md).

# Save user profile photo

To save user profile photo, use `.saveProfilePhoto` answer method or **SaveProfilePhoto class-method**

#### SaveProfilePhoto class-methods or .saveProfilePhoto method take arguments:

<table><thead><tr><th width="152" data-type="number">Argument</th><th width="360.3333333333333">Description</th><th>Required</th></tr></thead><tbody><tr><td>1</td><td>Path in which you want to save profile photo</td><td><strong>Required</strong></td></tr><tr><td>2</td><td>Index of the profile photo you want to save</td><td>Optional. 0 by default</td></tr></tbody></table>

{% code title="app.controller.ts" %}

```typescript
import { Controller, OnCommand, GetAnswer, Answer, ChatAction, SaveProfilePhoto, Photo } from 'nestgram';
import { AppService } from './app.service';
import * as path from 'path';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @OnCommand('start')
  async getChatAction(@GetAnswer() answer: Answer): Promise<ChatAction> {
    const imgPath: string = path.resolve(__dirname, 'profile-photo.jpeg');

    return new ChatAction('upload_photo')
      .next(new SaveProfilePhoto(imgPath))
      .next(new Photo('path', imgPath, null, false))
  }
}
```

{% endcode %}

{% hint style="info" %}
In the 15th line, we disabled the cache with the 4th argument, because user photo may change
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://degreetpro.gitbook.io/nestgram/api-reference/save-user-profile-photo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
