# 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: 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:

```
GET https://degreetpro.gitbook.io/nestgram/messages/copy-or-forward-a-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
