# Other arguments in handler

## Example

You can also use other parameter decorators: `@Text`, `@Message`, `@Update` and more. Just import it from the root of the framework and call it in arguments

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

```typescript
import { OnText, Controller, Text, Update, Message, IMessage, IUpdate } from 'nestgram';
import { AppService } from './app.service';

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

  @OnText()
  async onText(
    @Text() text: string, 
    @Update() update: IUpdate, 
    @Message() message: IMessage
  ): Promise<any> {
    console.log(update, message);
    return `I got your message! ${text}`;
  }
}
```

{% endcode %}

## All supported parameter decorators

<table><thead><tr><th width="195">Decorator</th><th>Return value</th><th width="235">Description</th><th>Parameters</th></tr></thead><tbody><tr><td>Text</td><td>string</td><td>Text of sent message</td><td>none</td></tr><tr><td>GetAnswer</td><td><a href="/pages/jU9Dr3ZyKnLHUw6u5p8y">Answer</a></td><td>Answer</td><td>none</td></tr><tr><td>Message</td><td><a href="https://core.telegram.org/bots/api#message">IMessage</a></td><td>Sent message</td><td>none</td></tr><tr><td>Update</td><td><a href="https://core.telegram.org/bots/api#update">IUpdate</a></td><td>Received update</td><td>none</td></tr><tr><td>Entites</td><td><a href="https://core.telegram.org/bots/api#messageentity">IMessageEntity</a>[]</td><td>Entities of sent message</td><td>none</td></tr><tr><td>CommandParams</td><td>string[]</td><td>Command params (e.g. when user starts bot using referral link)</td><td>none</td></tr><tr><td>Params</td><td>any</td><td>Your params (you can edit it in middlewares)</td><td>none</td></tr><tr><td>Sender</td><td><a href="https://core.telegram.org/bots/api#user">IUser</a></td><td>User info that sent a message</td><td>none</td></tr><tr><td>Chat</td><td><a href="https://core.telegram.org/bots/api#chat">IChat</a></td><td>The chat in which the message was sent</td><td>none</td></tr><tr><td>UserId</td><td>number</td><td>User id that sent a message</td><td>none</td></tr><tr><td>Entity</td><td><a href="https://core.telegram.org/bots/api#messageentity">IMessageEntity</a></td><td>Entity of sent message</td><td>entity (MessageEntityTypes type)</td></tr><tr><td>GetLocation</td><td><a href="https://core.telegram.org/bots/api#location">ILocation</a></td><td>Location that sent a user</td><td>none</td></tr><tr><td>GetVenue</td><td><a href="https://core.telegram.org/bots/api#venue">IVenue</a></td><td>Venue that sent a user</td><td>none</td></tr><tr><td>GetContact</td><td><a href="https://core.telegram.org/bots/api#contact">IContact</a></td><td>Contact that sent a user</td><td>none</td></tr><tr><td>GetPoll</td><td><a href="https://core.telegram.org/bots/api#poll">IPoll</a></td><td>Poll that sent a user or channel, or poll that was edited</td><td>none</td></tr><tr><td>GetDice</td><td><a href="https://core.telegram.org/bots/api#dice">IDice</a></td><td>Dice that sent a user</td><td>none</td></tr><tr><td>JoinRequest</td><td><a href="https://core.telegram.org/bots/api#chatjoinrequest">IChatJoinRequest</a></td><td>Chat join request that sent a user</td><td>none</td></tr></tbody></table>


---

# 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/handling-updates/other-arguments-in-handler.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.
