> 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/messages/copy-or-forward-a-message.md).

# Copy or Forward a message

## Forward a message

To forward a message, use **Forward class-method** or `.forward` **answer/api method**

{% hint style="info" %}
You can read more about Api methods [here](/nestgram/config/api-class.md#api-methods)

You can read more about Answer class [here](/nestgram/nestgram-features/answer-class.md)
{% endhint %}

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

```typescript
import { Controller, OnCommand, UserId, Forward } from 'nestgram';
import { AppService } from './app.service';

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

  @OnCommand('start')
  async start(@UserId() userId: number): Promise<Forward> {
    return new Forward(userId);
  }
}

```

{% endcode %}

## Copy message

You can copy message. This is similar to forwarding messages, but the sender's name will be removed, and you can also change the message options. Use **Copy class-method** or `.copy` **answer/api method**

#### Copy class-method or .copy Answer method take arguments:

<table><thead><tr><th width="210.33333333333331" data-type="number">Argument</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>1</td><td>Chat id you want to copy to</td><td><strong>Required</strong></td></tr><tr><td>2</td><td>Keyboard you want to add</td><td>Optional</td></tr><tr><td>3</td><td><a href="https://core.telegram.org/bots/api#copymessage">Options</a></td><td>Optional</td></tr></tbody></table>

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

```typescript
import { Controller, OnCommand, UserId, Copy, Keyboard, KeyboardTypes } from 'nestgram';
import { AppService } from './app.service';

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

  @OnCommand('start')
  async start(@UserId() userId: number): Promise<Copy> {
    return new Copy(userId, new Keyboard(KeyboardTypes.removeUnderTheChat));
  }
}
```

{% endcode %}

{% hint style="info" %}
If you want to know what arguments an API method takes, see the IDE hint
{% 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/messages/copy-or-forward-a-message.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.
